Richard,

After the weekend I will check your comments.
Here's the complete code of the script

code:
$installTxtDir = "%systemroot%\install"
If Exist ("$installTxtDir") = 0
Md "$installTxtDir"
EndIf

$dirSp2 = "%systemroot%\install\sp2"
$dirSp2Exist = Exist ("$dirSp2")
If $dirSp2Exist = 0
Md "$dirSp2"
EndIf

$backgroundFile = '%systemroot%\desktop.sys'
If Exist ("$backgroundFile") = 0
$instDirDesktop = "\\server\share\install\apps_install\desktop"
Copy "$instDirDesktop\desktop.sys" "%systemroot%"
EndIf

$sysdiffFiles = "%temp%\sysdiff.exe"
If Exist ("$sysdiffFiles") = 0
$instDirSysdiff = "\\server\share\install\apps_install\tools\sysdiff"
Copy "$instDirSysdiff\*.*" "%temp%"
EndIf

$keyHKUScreensaverActive = ReadValue("HKEY_USERS\.DEFAULT\Control Panel\Desktop", "ScreenSaveActive")
If $keyHKUScreensaverActive = 0
WriteValue ( "HKEY_USERS\.DEFAULT\Control Panel\Desktop","ScreenSaveActive","1","REG_SZ")
WriteValue ( "HKEY_USERS\.DEFAULT\Control Panel\Desktop","ScreenSaverIsSecure","1","REG_SZ")
WriteValue ( "HKEY_USERS\.DEFAULT\Control Panel\Desktop","ScreenSaveTimeOut","300","REG_SZ")
WriteValue ( "HKEY_USERS\.DEFAULT\Control Panel\Desktop","SCRNSAVE.EXE","%systemroot%\system32\scrnsave.scr","REG_SZ")
EndIf

$keyHKUBackground = ReadValue("HKEY_USERS\.DEFAULT\Control Panel\Desktop", "Wallpaper")
$backgroundFile = "%systemroot%\desktop.sys"
If $keyHKUBackground <> $backgroundFile
WriteValue ( "HKEY_USERS\.DEFAULT\Control Panel\Desktop", "Wallpaper", "%systemroot%\desktop.sys", "REG_SZ" )
WriteValue ( "HKEY_USERS\.DEFAULT\Control Panel\Desktop", "TileWallpaper", "0", "REG_SZ" )
WriteValue ( "HKEY_USERS\.DEFAULT\Control Panel\Desktop", "WallpaperStyle", "2", "REG_SZ" )
EndIf

WriteValue ( "HKEY_USERS\.DEFAULT\Control Panel\Colors","Background","55 0 123","REG_SZ")
WriteValue ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system", "dontdisplaylastusername", "1", "REG_DWORD")
WriteValue ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer", "NoWelcomeScreen", "1", "REG_DWORD")

Gosub acrobat
Gosub alh
Gosub pp
Gosub office97
Gosub huisstijl
Gosub winzip
Gosub notes
Gosub sms
Gosub win2k_sp2
Gosub ie5.5
Gosub deltemp
Gosub end
Gosub reboot

:acrobat
$acrobatTxtExist = Exist ("%systemroot%\install\acrobat.txt")
If $acrobatTxtExist = 0
$acrobatInstallDir = "\\server\share\install\apps_install\acrobat"
$acrobatCmdLine = "%comspec% /c $acrobatInstallDir\ar500enu.exe -s -a /s /f1$acrobatInstallDir\setup.iss"
Cls
"Installing Acrobat Reader..."
Shell $acrobatCmdLine
While Exist ("%systemdrive%\documents and settings\all users\start menu\programs\acrobat reader 5.0.lnk") = 0
Sleep 1
Loop
Md "%systemdrive%\documents and settings\all users\start menu\programs\Acrobat Reader"
Copy "%systemdrive%\documents and settings\all users\desktop\acrobat reader 5.0.lnk" "%systemdrive%\documents and settings\all users\start menu\programs\acrobat reader"
Del "%systemdrive%\documents and settings\all users\desktop\*.*"
Del "%systemdrive%\documents and settings\all users\start menu\programs\acrobat reader 5.0.lnk"
Shell "%comspec% /c echo Acrobat Reader 5 was installed on @DATE (YYYY/MM/DD) at @TIME > %systemroot%\install\acrobat.txt"
Shell "%comspec% /c echo Computersystem: @WKSTA >> %systemroot%\install\acrobat.txt"
EndIf
Return

:alh
$alhTxtExist = Exist ("%systemroot%\install\alh.txt")
If $alhTxtExist = 0
$alhInstallDir = "\\server\share\install\apps_install\alh"
$alhCmdLine = "%comspec% /c %temp%\sysdiff.exe /apply /m $alhInstallDir\alh.img"
Cls
"Installing ALH Routeplanner..."
Shell $alhCmdLine
Shell "%comspec% /c echo ALH Routeplanner was installed on @DATE (YYYY/MM/DD) at @TIME > %systemroot%\install\alh.txt"
Shell "%comspec% /c echo Computersystem: @WKSTA >> %systemroot%\install\alh.txt"
EndIf
Return

:pp
$ppTxtExist = Exist ("%systemroot%\install\pp.txt")
If $ppTxtExist = 0
$ppInstallDir = "\\server\share\install\apps_install\pp"
$ppCmdLine = "%comspec% /c %temp%\sysdiff.exe /apply /m $ppInstallDir\pp.img"
Cls
"Installing Professional Project..."
Shell $ppCmdLine
Shell "%comspec% /c echo Professional Project was installed on @DATE (YYYY/MM/DD) at @TIME > %systemroot%\install\pp.txt"
Shell "%comspec% /c echo Computersystem: @WKSTA >> %systemroot%\install\pp.txt"
EndIf
Return

:office97
$officeTxtExist = Exist ("%systemroot%\install\office97.txt")
If $officeTxtExist = 0
$officeInstallDir = "\\server\share\install\apps_install\office97"
$officeCmdLine = "%comspec% /c %temp%\sysdiff.exe /apply /m $officeInstallDir\office97.img"
Cls
"Installing Microsoft Office 97..."
Shell $officeCmdLine
Shell "%comspec% /c echo Microsoft Office 97 was installed on @DATE (YYYY/MM/DD) at @TIME > %systemroot%\install\office97.txt"
Shell "%comspec% /c echo Computersystem: @WKSTA >> %systemroot%\install\office97.txt"
EndIf
Return

:huisstijl
$huisstijlTxtExist = Exist ("%systemroot%\install\huisstijl.txt")
If $huisstijlTxtExist = 0
$huisstijlCmdLine = "%comspec% /c @ldrive\upd_huisstijl.bat"
Cls
"Installing Huisstijl..."
Shell $huisstijlCmdLine
Shell "%comspec% /c echo Huisstijl was installed on @DATE (YYYY/MM/DD) at @TIME > %systemroot%\install\huisstijl.txt"
Shell "%comspec% /c echo Computersystem: @WKSTA >> %systemroot%\install\huisstijl.txt"
EndIf
Return

:winzip
$winzipInstallDir = "\\server\share\install\apps_install\winzip"
$winzipTxtExist = Exist ("%systemroot%\install\winzip.txt")
$winzipCmdLine = "%comspec% /c %temp%\sysdiff.exe /apply /m $winzipInstallDir\winzip.img"
If $winzipTxtExist = 0
Cls
"Installing WinZIP..."
Shell $winzipCmdLine
Shell "%comspec% /c echo WinZIP 8.0 was installed on @DATE (YYYY/MM/DD) at @TIME > %systemroot%\install\winzip.txt"
Shell "%comspec% /c echo Computersystem: @WKSTA >> %systemroot%\install\winzip.txt"
EndIf
Return

:notes
$notesTxtExist = Exist ("%systemroot%\install\notes.txt")
If $notesTxtExist = 0
$notesInstallDir = "\\server\share\install\apps_install\notes"
$notesCmdLine = "%comspec% /c $notesInstallDir\setup.exe -s -f1 $notesInstallDir\setup.iss -f2%systemroot%\install\notes.log"
Cls
"Installing Lotus Notes..."
Shell $notesCmdLine
While Exist ("%systemdrive%\documents and settings\all users\start menu\programs\lotus applications\lotus notes.lnk") = 0
Sleep 2
Loop

$filename = "%systemroot%\install\notes.log"
$lineno = 10
If Open( 1, $filename ) = 0
$n = 1
While @ERROR = 0
$line = ReadLine(1)
If $n = $lineno
If ( InStr ( $line, "ResultCode=0" ) <> 0 )
Shell "%comspec% /c echo Lotus Notes was installed on @DATE (YYYY/MM/DD) at @TIME > %systemroot%\install\notes.txt"
Shell "%comspec% /c echo Computersystem: @WKSTA >> %systemroot%\install\notes.txt"
EndIf
EndIf
$n=$n+1
Loop
$=Close(1)
EndIf
EndIf
Return

:sms
$smsTxtExist = Exist ("%systemroot%\install\sms.txt")
If $smsTxtExist = 0
$smsCmdLine = "%comspec% /c @lserver\netlogon\smsls.bat"
Cls
"Installing SMS Client-software..."
Shell $smsCmdLine
Shell "%comspec% /c echo Microsoft SMS Client-software was installed on @DATE (YYYY/MM/DD) at @TIME > %systemroot%\install\sms.txt"
Shell "%comspec% /c echo Computersystem: @WKSTA >> %systemroot%\install\sms.txt"
EndIf
Return

:win2k_sp2
$rebootTxtExist = Exist ("%systemroot%\install\reboot.txt")
$win2k_sp2TxtExist = Exist ("%systemroot%\install\win2k_sp2.txt")
Select
Case $rebootTxtExist = 0 And $win2k_sp2TxtExist = 0
$sp2CopyDir = "\\server\share\install\apps_install\sp2"
$sp2InstallDir = "%systemroot%\install\sp2"
$sp2CmdLine = "$sp2InstallDir\w2ksp2.exe -u -n -o -z";
If Exist ("%systemroot%\install\sp2") <> 0
If Exist ("$sp2InstallDir\w2ksp2.exe") = 0
Cls
"Copying Windows 2000 Service Pack 2..."


;AFAIK here starts the problem, this line is not executed, so;the w2ksp2.exe does not exist and therefore cannot be installed

Copy "$sp2CopyDir\w2ksp2.exe" "$sp2InstallDir"
EndIf
EndIf
Cls
"Installing Windows 2000 Service Pack 2..."
Shell $sp2CmdLine
Shell "%comspec% /c echo Windows 2000 ServicePack 2 was installed on @DATE (YYYY/MM/DD) at @TIME > %systemroot%\install\win2k_sp2.txt"
Shell "%comspec% /c echo Computersystem: @WKSTA >> %systemroot%\install\win2k_sp2.txt"
Case $rebootTxtExist = 1 And $win2k_sp2TxtExist = 0
$sp2CopyDir = "\\server\share\install\apps_install\sp2"
$sp2InstallDir = "%systemroot%\install\sp2"
$sp2CmdLine = "$sp2InstallDir\w2ksp2.exe -u -n -o -z";
If Exist ("$sp2InstallDir\w2ksp2.exe") = 0
Cls
"Copying Windows 2000 Service Pack 2..."
Copy "$sp2CopyDir\w2ksp2.exe" "$sp2InstallDir"
EndIf
Cls
"Re-installing Windows 2000 Service Pack 2..."
Shell $sp2CmdLine
Shell "%comspec% /c echo Windows 2000 ServicePack 2 was re-installed on @DATE (YYYY/MM/DD) at @TIME > %systemroot%\install\win2k_sp2.txt"
Shell "%comspec% /c echo Computersystem: @WKSTA >> %systemroot%\install\win2k_sp2.txt"
Shutdown ("", "", 0, 1, 1)
EndSelect
Return

:ie5.5
$rebootTxtExist = Exist ("%systemroot%\install\reboot.txt")
$ie55TxtExist = Exist ("%systemroot%\install\ie55.txt")
Select
Case $rebootTxtExist = 0 And $ie55TxtExist = 0
$ieInstallDir = "\\server\share\install\apps_install\ie5.5\flat\win32\en"
$ieCmdLine = "$ieInstallDir\ie5setup.exe /R:N"
Cls
"Installing Internet Explorer 5.5..."
Shell $ieCmdLine
Shell "%comspec% /c echo Internet Explorer 5.5 was installed on @DATE (YYYY/MM/DD) at @TIME > %systemroot%\install\ie55.txt"
Shell "%comspec% /c echo Computersystem: @WKSTA >> %systemroot%\install\ie55.txt"
Case $rebootTxtExist = 1 And $ie55TxtExist = 0
$ieInstallDir = "\\server\share\install\apps_install\ie5.5\flat\win32\en"
$ieCmdLine = "$ieInstallDir\ie5setup.exe /R:N"
Cls
"Re-installing Internet Explorer 5.5..."
Shell $ieCmdLine
Shell "%comspec% /c echo Internet Explorer 5.5 was re-installed on @DATE (YYYY/MM/DD) at @TIME > %systemroot%\install\ie55.txt"
Shell "%comspec% /c echo Computersystem: @WKSTA >> %systemroot%\install\ie55.txt"
Shutdown ("", "", 0, 1, 1)
EndSelect
Return

:deltemp
Call "@LSERVER\netlogon\del_temp.kix"
Return

:end
Select
Case Exist ("%systemroot%\install\reboot.txt") = 0
$shortcutSourceQuickLaunch = "%systemdrive%\documents and settings\all users\start menu\programs"
$shortcutTargetQuickLaunch = "%systemdrive%\documents and settings\default user\application data\microsoft\internet explorer\quick launch"
Md "$shortcutTargetQuickLaunch"
Copy "$shortcutSourceQuickLaunch\lotus applications\lotus notes.lnk" "$shortcutTargetQuickLaunch"
Copy "$shortcutSourceQuickLaunch\alh\alh-routeplanner.lnk" "$shortcutTargetQuickLaunch"
Copy "$shortcutSourceQuickLaunch\microsoft office\microsoft excel.lnk" "$shortcutTargetQuickLaunch"
Copy "$shortcutSourceQuickLaunch\microsoft office\microsoft powerpoint.lnk" "$shortcutTargetQuickLaunch"
Copy "$shortcutSourceQuickLaunch\microsoft office\microsoft word.lnk" "$shortcutTargetQuickLaunch"
Copy "$shortcutSourceQuickLaunch\professional project\professional project.lnk" "$shortcutTargetQuickLaunch"
Copy "%systemdrive%\documents and settings\default user\start menu\programs\accessories\windows explorer.lnk" "$shortcutTargetQuickLaunch"
Copy "%systemdrive%\documents and settings\all users\start menu\windows update.lnk" "%systemdrive%\documents and settings\all users\start menu\programs\accessories\system tools"
Del "%systemdrive%\documents and settings\all users\start menu\windows update.lnk"
Del "%systemdrive%\documents and settings\all users\start menu\programs\accessories\system tools\getting started.lnk"
Copy "%systemdrive%\documents and settings\default user\start menu\programs\accessories\windows explorer.lnk" "%systemdrive%\documents and settings\all users\start menu\programs"
Copy "%systemdrive%\documents and settings\default user\start menu\programs\accessories\*.*" "%systemdrive%\documents and settings\all users\start menu\programs\accessories"
Copy "%systemdrive%\documents and settings\default user\start menu\programs\accessories\accessibility\*.**.*" "%systemdrive%\documents and settings\all users\start menu\programs\accessories\accessibility"
Copy "%systemdrive%\documents and settings\default user\start menu\programs\accessories\entertainment\*.*" "%systemdrive%\documents and settings\all users\start menu\programs\accessories\entertainment"
Copy "%systemdrive%\documents and settings\default user\start menu\programs\accessories\system tools\*.*" "%systemdrive%\documents and settings\all users\start menu\programs\accessories\system tools"
Del "%systemdrive%\documents and settings\default user\start menu\*.*"
Del "%systemdrive%\documents and settings\default user\start menu\programs\*.*"
Del "%systemdrive%\documents and settings\default user\start menu\programs\accessories\*.*"
Del "%systemdrive%\documents and settings\default user\start menu\programs\accessories\accessibility\*.*"
Del "%systemdrive%\documents and settings\default user\start menu\programs\accessories\entertainment\*.*"
Del "%systemdrive%\documents and settings\default user\start menu\programs\accessories\system tools\*.*"
Rd "%systemdrive%\documents and settings\default user\start menu\programs\accessories\system tools"
Rd "%systemdrive%\documents and settings\default user\start menu\programs\accessories\entertainment"
Rd "%systemdrive%\documents and settings\default user\start menu\programs\accessories\accessibility"
Rd "%systemdrive%\documents and settings\default user\start menu\programs\accessories"
Rd "%systemdrive%\documents and settings\default user\start menu\programs"
Rd "%systemdrive%\documents and settings\default user\start menu"

Shell "%comspec% /c echo The computer was being rebooted on @DATE (YYYY/MM/DD) at @TIME > %systemroot%\install\reboot.txt"

Shutdown ("", "", 0, 1, 1)

Case Exist ("%systemroot%\install\reboot.txt")
EndSelect
Return

Exit


Martijn

[ 02 November 2001: Message edited by: MartijnL ]