#77229 - 2003-10-24 04:10 PM
Runas and Sanur
|
Hawk
Lurker
Registered: 2003-10-24
Posts: 2
|
I am working on a script which uses Runas to install security patches, and Sanur to provide the password. Runas and Sanur work fine. The problem is that once sanur.exe quits on my system, the script continues to run without waiting for the security patches to complete. Here's the runas line in my script:
Shell '%comspec% /c "runas /env /user:$domain\$userid "$program" | \\sawpdc01\patches\sanur.exe password"'
Is there something wrong with this line in my script, or is there a way that I can make the sytem wait until the patch is installed before continuing?
Thanks
|
Top
|
|
|
|
#77230 - 2003-10-24 04:23 PM
Re: Runas and Sanur
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
quote: Check what switches "$program" supports. IIRC MS patches have a switch which will suspend the calling process until it completes.
Ignore me, I'm talking garbage [ 24. October 2003, 16:27: Message edited by: Richard H. ]
|
Top
|
|
|
|
#77231 - 2003-10-24 04:44 PM
Re: Runas and Sanur
|
Richie19Rich77
Seasoned Scripter
Registered: 2002-08-16
Posts: 624
Loc: London, England
|
I have a RunAs program designed by ANB Software that is a upgraded version of the Windows RunAs.
FreeWare, and allows you to type the password within the command line, so it will allow you to do the command you are using without using sanur.exe .
But remember to make it secure you should use KixCrypt to wrap it up in a exe file. RunAs - ANB Software Download.
|
Top
|
|
|
|
#77232 - 2003-10-24 04:48 PM
Re: Runas and Sanur
|
Richie19Rich77
Seasoned Scripter
Registered: 2002-08-16
Posts: 624
Loc: London, England
|
code:
Shell '%COMSPEC% /c RunAs.exe /user:'+$User+' "'+$CommandLine+'" | C:\sanur.exe '+$Pass'
This should be the command you want for the old RunAs or below using the new RunAs software.
code:
Shell '%COMSPEC% /c RunAs.exe /user:'+$User+' /pass:'+$Pass+' "'+$CommandLine+'"'
|
Top
|
|
|
|
#77234 - 2003-10-24 05:36 PM
Re: Runas and Sanur
|
Hawk
Lurker
Registered: 2003-10-24
Posts: 2
|
Thanks everyone! I downloaded the upgraded version of RunAs and at first I had the same problem using that file. However, that version of RunAs allows you to put a "/w" to wait for the program to finish, which did the trick!
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 515 anonymous users online.
|
|
|