|
Re: Runas problem (kind of....): msg#00268windows.autoit.user
Forgot to mention that I added new Arguments. 5,6 and 7 ;7 Arguments ; $Argument1 = Path and name of the executable ; $Argument2 = Username to run it under including domain. If local account use computer name. Format Domain\\User or User@xxxxxxxxxx or %computername%\\User ; $Argument3 = Password ; $Argument4 = Amount of time to wait for the command window before giving an error. Time is in seconds ; $Argument5 = 1 to load the profile, 0 to not ; $Argument6 = 1 to use the current environment, 0 to not ; $Argument7 = 1 if credentials are specified for remote access only, 0 if not red --- In AutoItList@xxxxxxxxxxxxxxx, "Redndahead" <amoore@xxxx> wrote: > Uploaded runas function. Some new changes for stability. > > http://groups.yahoo.com/group/AutoItList/files/FUNCTIONS/Runas.aut > > red > --- In AutoItList@xxxxxxxxxxxxxxx, "Redndahead" <amoore@xxxx> wrote: > > You will still have an error if the password is wrong. Maybe it is > > just undetectable. I will leave it up to the user to detect if > their > > program they are running is running or not. > > > > Upload in a second. > > > > red > > --- In AutoItList@xxxxxxxxxxxxxxx, "Private Name" > <larrydalooza@xxxx> > > wrote: > > > > Maybe I can leave it up to the user, but do you > > > > have an idea on how? I used to redirect the output to a text > > file > > > > and check for an error in the text file. using run,runas > doesn't > > > > allow you to redirect to a text file. > > > > > > > > red > > > > > > runas.exe kicks out an errorlevel... compile the following, > > changing > > > the %user% and %pass% and see what happens... > > > > > > ;runas test > > > SetBatchLines,150 > > > SetWinDelay,1 > > > SetTitleMatchMode,2 > > > > > > setenv,user,username > > > setenv,pass,password > > > > > > ifequal,0,1,Goto,%1% > > > > > > Run,"%A_SCRIPTFULLPATH%" runas > > > RunWait,runas /user:%user% cmd.exe > > > MsgBox,4096,test,%errorlevel% > > > Exit > > > > > > runas: > > > winwait,runas.exe,,60 > > > IfEqual,errorlevel,1,Exit > > > Sleep,500 > > > IfWinNotActive,runas.exe,,WinActivate,runas.exe > > > WinWaitActive,runas.exe,,60 > > > IfEqual,errorlevel,1,Exit > > > Send,%pass%{ENTER} > > > Exit > > > > > > ;... as for making it a useful function when the script Isn't > > > compiled... I don't know how you will get the errorlevel from > runas > > > without the RunWait... > > > > > > Larry ------------------------ Yahoo! Groups Sponsor ---------------------~--> Looking for the latest Free IT White Papers? Visit SearchMobileComputing.com to access over 500 white papers. Get instant access at SearchMobileComputing.com Today http://us.click.yahoo.com/ZyjvfD/PLNGAA/uitMAA/EGnolB/TM ---------------------------------------------------------------------~-> To unsubscribe from this group, send an email to: AutoItList-unsubscribe@xxxxxxxxxxxxxxx Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Runas problem (kind of....): 00268, Redndahead |
|---|---|
| Next by Date: | Re: Right clicking the system tray: 00268, The_BigHam |
| Previous by Thread: | Re: Runas problem (kind of....)i: 00268, Redndahead |
| Next by Thread: | adding to the middle of a string better organized: 00268, Sensei J. Richard Kirkham B.Sc |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |