Here's a larger sample of the code where the problem occurs. Like I said, everything works fine - it just sometimes writes $errmsg 3 times.
code:
If $spack < 3
$start = @TIME
If Exist("f:\EFOupdts\w2k\W2ksp3\i386\update\update.exe") ;check for 'F' drive mapped to local server for source files
$check = "ok"
Else
$errmsg = "Update cannot continue - the F: drive is not present."
Goto END
EndIf
?"Checking for necessary disk space ..."
Sleep 2
If $HDspace < 179200
$errmsg = "Disk space is insufficient for Win2K PRO Service Pack 3 install"
?"Disk space is insufficient - terminating update."
Sleep 4
Goto END
Else
?"Disk space is sufficient."
Sleep 2
Del("c:\efo\"+@WKSTA+".efo")
CLS
?" Updates required. Please read message and click on OK."
$Inst = MessageBox("Your PC needs to be updated to Windows 2000 Professional Service Pack 3."
+ " This install will begin when you click the OK button. Depending on your"
+ " network connection and the speed of your computer, this update can take"
+ " anywhere from 15 to 45 minutes. Please do not run any programs during this time."
+ " Your PC will reboot automatically when the update is complete."
+ Chr(13) + Chr(10) + "" + Chr(13) + Chr(10)
+ "We apologize for any inconvenience that this may cause you, but this update"
+ " is necessary to keep your PC in compliance with security standards."
+ Chr(13) + Chr(10) + "","WFSC System Updates",48)
CLS
??""
?" Initiating install..."
??" Please be patient. DO NOT CANCEL THIS PROCESS!"
?" DOING SO COULD CAUSE YOUR PC TO MALFUNCTION."
??" Your PC will reboot when the update is complete."
Shell "%comspec% /c f:\EFOupdts\w2k\W2ksp3\i386\update\update.exe -u -f -n -o -z"
If @ERROR = "1603"
$RC = MessageBox(@FULLNAME+", please do not cancel the update process. This update"
+ " is required for your PC to meet security standards. "
+ Chr(13) + Chr(10) + "" + Chr(13) + Chr(10)
+ "Please click RETRY to restart the update program. If you choose"
+ " to click cancel, your user information will be logged. "
+ Chr(13) + Chr(10) + "You will prompted to perform the update each"
+ " time you log on." + Chr(13) + Chr(10) + "" + Chr(13) + Chr(10)
+ "Thank you.","Cancellation Warning",21)
If $RC = 4
Shell "%comspec% /c f:\EFOupdts\w2k\W2ksp3\i386\update\update.exe -u -f -n -o -z"
If @ERROR = "1603"
Shell '%comspec% /c echo @TIME @DATE @USERID @WKSTA - Win2K Service Pack 3'
+ ' installation began at '+$start+' and was cancelled by the user.'
+ '>> \\servername\efolan\efoupdts\errors\aborted.err'
Goto End
EndIf
Else
Shell '%comspec% /c echo @TIME @DATE @USERID @WKSTA - Win2K Service Pack 3'
+ ' installation began at '+$start+' and was cancelled by the user.'
+ '>> \\servername\efolan\efoupdts\errors\aborted.err'
Goto END
EndIf
EndIf
CLS
??" Updating the registry ..."
$RC = WriteValue("HKEY_LOCAL_MACHINE\Software\EFO\Installed By Script\ServicePacks\SP1","InstallDate","@DATE","Reg_SZ")
$RC = WriteValue("HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\AU","NoAutoUpdate","1","Reg_DWORD")
?" Update complete."
$stop = @TIME
??"Updating installation log..."
Shell '%comspec% /c echo @TIME @DATE @USERID @WKSTA - Win2K Service Pack 3'
+ ' installation began at '+$start+' and ended at '+$stop
+ '>> \\servername\efolan\efoupdts\errors\timelog.err'
??" Initiating system shutdown"
Sleep 3
$RC = Shutdown("", "System will now reboot to enable new settings.", 10, 1, 1)
EndIf
EndIf
Goto END ;this is here because there is actually a lot more code before the END label
:END
If $errmsg <> ""
Shell '%comspec% /c echo @TIME @DATE @USERID @FULLNAME @WKSTA - '+$errmsg+'>> \\servername\efolan\efoupdts\errors\errors.err'
EndIf
Exit
[ 03. March 2003, 16:42: Message edited by: Jtel ]