You should also read about the If syntax. Your GOSUBs are not necessary and they are actually wrong. You would rather use GOTO to GO TO a label, not GOSUB to GO to a SUBroutine.
Proper code would be
code:
$ServPk = readvalue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion","CSDVersion")
IF $ServPk = "Service Pack 2"
? "Service Pack 2 installed."
Else
shell '%COMSPEC% /c \\serv4\it$$\Install\ServicePacks\Win2kSP2\i386\update\update.exe /u /f /n'
endif

IF EXIST ("c:\program files\Internet explorer\custom\inetset.inf")
? "IE6 Already installed"
ELSE
shell '%COMSPEC% /c \\serv4\distro\IE6\FLAT\WIN32\EN\ie6setup.exe'
endif

? "test end"
EXIT

However, you should realize that those installs require administrative privileges and the computer needs to reboot in order to finish the install correctly.

For IE6 installation, please use the Internet Explorer Administration Kit.

[ 23. August 2002, 00:34: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.