logo       

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

windows.autoit.user

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

It seems that RUNAS forces the program being run to use the working
dir '%windir%\\system32' or the same as runas resides in. This messes
up some programs that rely on the working directory to be the same as
the EXE. No matter what you do, the working directory cannot be
changed, so I had him create a launch program (compiled autoit
script) with...

Run,"c:\\his path\\his exe.exe",c:\\his path

... then your routine works primo if he launches the compiled autoit
script that in turn launches his program with the correct working
dir... this is a problem with runas...

Larry

--- In AutoItList@xxxxxxxxxxxxxxx, "Redndahead" <amoore@xxxx> wrote:
> I can't see what is the problem...What did you notice larry that is
> happening that my function won't work?
>
> red
>
> --- In AutoItList@xxxxxxxxxxxxxxx, "Private Name"
<larrydalooza@xxxx>
> wrote:
> > try this....
> >
> > create a 'compiled' autoit script...
> >
> > ;compile me to c:\\customlaunch.exe
> > Run,"c:\\path to\\your\\EXE.exe",c:\\path to\\your
> > ;end script
> >
> > then do...
> >
> > SetEnv,user,username
> > SetEnv,password,password
> >
> > SetBatchLines,150
> > SetWinDelay,1
> > DetectHiddenText,on
> > SetTitleMatchMode,2
> >
> > Run,runas /user:%user% "c:\\customlaunch.exe",,hide
> >
> > WinWait,runas.exe,,30
> > WinMove,runas.exe,,-2000,-2000,default,default
> > IfEqual,errorlevel,1,Goto,noGood
> > IfWinNotActive,runas.exe,,WinActivate,runas.exe
> > WinWaitActive,runas.exe,,30
> > IfEqual,errorlevel,1,Goto,noGood
> > Send,%password%{ENTER}
> > Exit
> >
> > noGood:
> > MsgBox,4096,Error,Script Error
> > Exit
> >
> >
> > --- In AutoItList@xxxxxxxxxxxxxxx, "Kenneth M. Hargis"
> > <stiletto@xxxx> wrote:
> > >
> > > That one worked. :)
> > >
> > > But a bit faster would be great. More stealthy would also be
> > nice. I'd
> > > like it to be as seamless for the users as possible. But hey,
> all
> > I really
> > > wanted was something that worked. :)
> > >
> > > Thanks!
> > >
> > > -Ken
> > >
> > >
> > >
> > > >try this...
> > > >lemme know if it needs to be faster and stealthy?
> > > >
> > > >
> > > >SetEnv,user,youruser
> > > >SetEnv,password,yourpass
> > > >SetEnv,your_program,your_exe_name_no_path
> > > >SetEnv,workdir,path_for_your_exe
> > > >
> > > >SetTitleMatchMode,2
> > > >Run,runas /user:%user% "%comspec%"
> > > >
> > > >WinWait,runas.exe,,30
> > > >IfEqual,errorlevel,1,Goto,noGood
> > > >IfWinNotActive,runas.exe,,WinActivate,runas.exe
> > > >WinWaitActive,runas.exe,,30
> > > >IfEqual,errorlevel,1,Goto,noGood
> > > >Send,%password%{ENTER}
> > > >
> > > >WinWait,cmd.exe,,30
> > > >IfEqual,errorlevel,1,Goto,noGood
> > > >IfWinNotActive,cmd.exe,,WinActivate,cmd.exe
> > > >WinWaitActive,cmd.exe,,30
> > > >IfEqual,errorlevel,1,Goto,noGood
> > > >Send,cd "%workdir%"{ENTER}
> > > >Sleep,1000
> > > >Send,start "" "%your_program%"{ENTER}
> > > >Sleep,1000
> > > >WinClose,cmd.exe
> > > >Exit
> > > >
> > > >noGood:
> > > >MsgBox,4096,Error,Script Error
> > > >Exit
> > > >
> > > >
> > > >
> > > >Yahoo! Groups Sponsor
> > > >ADVERTISEMENT
> > >
> >
>
><http://rd.yahoo.com/M=244522.3313099.4604523.1261774/D=egroupweb/S=1
> >
>
705144708:HM/A=1595055/R=0/SIG=1240u9le2/*http://ashnin.com/clk/muryut
> > aitakenattogyo?YH=3313099&yhad=1595055>136e06.jpg
> > > >136e7f.jpg
> > > >
> > > >To unsubscribe from this group, send an email to:
> > > >AutoItList-unsubscribe@xxxxxxxxxxxxxxx
> > > >
> > > >
> > > >
> > > >Your use of Yahoo! Groups is subject to the
> > > ><http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Looking for the latest Free IT White Papers?
Visit SearchSecurity.com to access over 500 white papers.
Get instant access at SearchSecurity.com Today
http://us.click.yahoo.com/ayjvfD/QLNGAA/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