I'm trying to write a wee script to install Exchange + patches all at once. This is what I have so far:
For some reason, instead of waiting for each line to finish executing, the script immediately starts processing the next line. The reason I chose vb was to avoid having to do the whole "command /c start /w" routine in DOS. If I have to do that here as well, I might as well do it in DOS.
If I'm doing something obviously stupid, please let me know.
Code:
Option Explicit
Dim FSO, WshShell, result
Set FSO = CreateObject("Scripting.FileSystemObject")
Set WshShell = WScript.CreateObject("WScript.Shell")
result = WshShell.Run("Exchange2003\SETUP\I386\SETUP.EXE /unattendfile unattend.ini", 1, TRUE)
if result=0 then result = WshShell.Run("WindowsServer2003-KB831464-x86-ENU.exe /quiet /norestart", 1, TRUE)
...[serveral more patches]
if result=0 then wscript.echo ("Done!" & vbcrlf & vbcrlf & "Please REBOOT now.")
For some reason, instead of waiting for each line to finish executing, the script immediately starts processing the next line. The reason I chose vb was to avoid having to do the whole "command /c start /w" routine in DOS. If I have to do that here as well, I might as well do it in DOS.
If I'm doing something obviously stupid, please let me know.