logo       

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

windows.autoit.user

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

I wrote a runas function which you can find here:
http://groups.yahoo.com/group/AutoItList/files/FUNCTIONS/Runas.aut

Here are the options
;4 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
; $Argument3 = Password
; $Argument4 = Amount of time to wait for the command window
before giving an error. Time is in seconds
;
;Output
; $ErrorLevel = 0 it ran successfully, 1 it was unsuccessfull
;
;Example

Here is how to make the script make sure runas.aut is in the same
folder as the script.

SetBatchLines,150
SetEnv,$Argument1,notepad
SetEnv,$Argument2,
SetEnv,$Argument3,
SetEnv,$Argument4,5
GoSub,$Runas
IfEqual,$ErrorLevel,0,MsgBox,0,,It was successfull.
IfEqual,$ErrorLevel,1,MsgBox,0,,It was unsuccessfull.
Exit
#Include runas.aut

If you have any questions feel free to ask.

red
--- In AutoItList@xxxxxxxxxxxxxxx, "Kenneth M. Hargis"
<stiletto@xxxx> wrote:
> Okay. I am trying to get an application to run under
Administrator, but
> for some reason it can't seem to find the directory that the
software is
> installed to, even if I have it in the path on the machine. It
seems to be
> looking for the associated files for the program in \winnt\system32
only,
> and I get errors when it can't find them.
>
> The script I'm using is:
>
> HideAutoItWin, on
> SetCapslockState, off
> Run, C:\\WINNT\\System32\\runas.exe /user:%computername%
\\Administrator
> "C:\\YARDI\\PMWPROG\\MMW.EXE",C:\\YARDI\\PMWPROG,,hide
> Send, <password>{ENTER}
> Exit
>
> Am I correct in thinking that putting the path for the program as
the next
> thing in the command line /should/ give it the appropriate working
> directory? If that's the case, it doesn't seem to. Any
suggestions/ ideas?
>
> Thanks!
>
> KMH


------------------------ 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