Hi,

I wrote the following script to image a machine over network.

Set WshShell=WScript.CreateObject("WScript.Shell")
Set WshSysEnv=WshShell.Environment("SYSTEM")
Set oShell = WScript.CreateObject ("WScript.shell")
ImagePath=WshSysEnv("ImagePath")
WScript.Echo "Done"

sCommand="X:\GHOST80\GHOST32 -clone,mode=restore,src=" & ImagePath &
",dst=1 -sure -FX"

oShell.run sCommand
oShell.run "X:\Scripts\PostImage\PostImage.bat"

Now, when I run this script, GHOST32 imaging starts and immediately
after that PostImage.BAT also starts which is not expected. I
understand this behavior because I haven't told my script to wait till
the previous command finishes. GHOST32 returns true value to my script
and it then start executing PostImage.BAT

Is there anyway I make the script to wait till GHOST imaging process is
complete and then execute PostImage.BAT command.

Thanks in advance,
Ravi

Re: Command execution in VBScript by Ravi

Ravi
Thu May 26 07:35:28 CDT 2005

Nevermind..
I did some search myself and found that oShell.run has an option to do
that.
oShell.run "command",1,true

I should have done my home work before posting this.

Thanks for your time
Ravi


Re: Command execution in VBScript by Michael

Michael
Thu May 26 23:08:52 CDT 2005

> I should have done my home work before posting this.

...which is easier with a local copy of the documentation.

Download details: Windows Script Documentation
http://www.microsoft.com/downloads/details.aspx?FamilyID=01592c48-207d-4be1-8a76-1c4099d7bbb9&DisplayLang=en


--
Michael Harris
Microsoft MVP Scripting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Please ask follow-up questions via the original newsgroup thread.