The folowing line will install the patch and return to the scritp only after completion
code:
Shell '%COMSPEC% /e:1024 /c START /MIN /WAIT "'+$path+'\eng\5.01 SP2\q319182.exe" /Q:A /R:N /N:V'
$retcode=shutdown('','Rebooting '+@WKSTA+' after installing mandatory software updates',10,1,1)

I use the shotdown command quite extensively in my maintenance script. Based on a flag the reboot routine will be triggered at the end of the script. you can find my reboot routine here: RebootWarning() at http://kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=12&t=000140

[ 05 April 2002, 16:27: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.