Page 1 of 1 1
Topic Options
#77229 - 2003-10-24 04:10 PM Runas and Sanur
Hawk Offline
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 Offline
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 [Embarrassed]

[ 24. October 2003, 16:27: Message edited by: Richard H. ]

Top
#77231 - 2003-10-24 04:44 PM Re: Runas and Sanur
Richie19Rich77 Offline
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 Offline
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
#77233 - 2003-10-24 05:05 PM Re: Runas and Sanur
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Hawks problem is not that the job doesn't run (it does) but that he wants the script to suspend while it is running.
Top
#77234 - 2003-10-24 05:36 PM Re: Runas and Sanur
Hawk Offline
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
#77235 - 2003-10-25 02:23 PM Re: Runas and Sanur
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Great, another script that puts administrative passwords into it in plain text!

Please read Installing an Application as an Admin and NEVER put admin passwords into scripts!
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 515 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.055 seconds in which 0.024 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org