logo       

Re: Runas problem (kind of....): msg#00266

windows.autoit.user

Subject: Re: Runas problem (kind of....)

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>
Google Custom Search

News | FAQ | advertise