Still an error.... I have tried everything, I almost smashed my pc on the ground...(Grrr)

Code:
 break on

;************************************ W2K HotFix Updates *****************************************
;Go c:
?""
?""
If @producttype="Windows 2000 Server"
$setup='\\server\srvpatch$'
$arrkey = arrEnumKey('HKLM\SOFTWARE\Microsoft\Updates\Windows 2000\SP5')
$arrdir = arrEnumDir($setup+'\w2k_hotfixes','*.exe',1)
$reboot = 0
For Each $Dir in $arrdir
$installed = 0
$parsed = Split($Dir,'-')[1]
For Each $key in $arrkey
If $key = $parsed
$installed = 1
EndIf
Next
If NOT $installed
$=SendMessage(@wksta,"A CRTICAL upgrade is now starting. Your computer will restart on it's own in about 2-3 minutes. Please do not open any programs. There is no need to click the OK button.")
? ' Installing '+$parsed
Shell '%comspec% /c ' + $Dir + ' -z -u -o' ; -q -n
;$ = WriteProfileString($logon+'\inventory\HotFix.log', $parsed, @wksta, @date)
$reboot = 1
EndIf
Next
If $reboot
Shutdown ('', 'Updates have been applied that require to computer to restart', 5, 1, 1)
Quit
EndIf
EndIf

;UDF's
;****************************************************************************************************
Function arrenumkey($regkey)
Dim $Keylist, $c
If NOT KeyExist($regkey) Exit 87 EndIf
Do
$Key = $Key+'|'+EnumKey($regkey,$c)
$c = $c + 1
Until @error
$arrenumkey = Split(SubStr($Key,2,Len($Key)-2),'|')
EndFunction
;****************************************************************************************************
Function WshPipe($ShellCMD, OPTIONAL $NoEcho)
Dim $oExec, $Output
$oExec = CreateObject("WScript.Shell").Exec($ShellCMD)
If NOT VarType($oExec)=9 $WshPipe="WScript.Shell Exec Unsupported" Exit 10 EndIf
While NOT $oExec.Status Loop
$Output = $oExec.StdOut.ReadAll + $oExec.StdErr.ReadAll
If NOT $NoEcho $Output EndIf
$WshPipe=Split($Output,Chr(10))
Exit($oExec.ExitCode)
EndFunction
;****************************************************************************************************
Function arrEnumdir($directory, optional $mask, Optional $Subdir)
If $subdir $subdir='/s' EndIf
If Exist($directory)
? "$directory\$mask"
shell '%comspec% /c dir "$directory\$mask" /b $subdir'
$E = WshPipe('%comspec% /c dir "$directory\$mask" /b $subdir',1)
? ubound($e)
redim preserve $e[ubound($e)-1]
? @ERROR+'-'+@serror
$arrEnumdir=Split(Join($e,'|'),Chr(13)+'|')
Else
Exit 87
EndIf
EndFunction



XP = still OK
Output W2K:

Code:
 

\\server\srvpatch$\w2k_hotfixes\ENU_Q832483_MDAC_x86.EXE
\\server\srvpatch$\w2k_hotfixes\Q331953_W2K_SP4_X86_EN.exe
\\server\srvpatch$\w2k_hotfixes\Q810833_W2K_SP4_X86_EN.exe
\\server\srvpatch$\w2k_hotfixes\Windows2000-KB817606-x86-ENU.exe
\\server\srvpatch$\w2k_hotfixes\Windows2000-KB823182-x86-ENU.exe
\\server\srvpatch$\w2k_hotfixes\Windows2000-KB823980-x86-ENU.exe
\\server\srvpatch$\w2k_hotfixes\Windows2000-KB824141-x86-ENU.exe
\\server\srvpatch$\w2k_hotfixes\Windows2000-KB824146-x86-ENU.exe
\\server\srvpatch$\w2k_hotfixes\Windows2000-KB825119-x86-ENU.exe
\\server\srvpatch$\w2k_hotfixes\Windows2000-KB826232-x86-ENU.exe
\\server\srvpatch$\w2k_hotfixes\Windows2000-KB828035-x86-ENU.exe
c:\WINNT\system32\cmd.exe /c dir "\\server\srvpatch$\w2k_hotfixes\*.exe" /b /s
-1
ERROR : array reference out of bounds!
Script: \\server\srvpatch$\W2k_hotfixes.kix
Line : 48



XP:
Quote:


OS Name Microsoft Windows XP Professional
Version 5.1.2600 Service Pack 1 Build 2600
OS Manufacturer Microsoft Corporation
System Name TESTPC2
System Manufacturer Hewlett-Packard
System Model HP d530 SFF(DC578AV)
System Type X86-based PC
Processor x86 Family 15 Model 2 Stepping 7 GenuineIntel ~2660 Mhz
BIOS Version/Date Hewlett-Packard 786B2 v2.04, 10/3/2003
SMBIOS Version 2.3
Windows Directory C:\WINDOWS
System Directory C:\WINDOWS\System32
Boot Device \Device\HarddiskVolume1
Locale United States
Hardware Abstraction Layer Version = "5.1.2600.1106 (xpsp1.020828-1920)"
User Name Domain\User
Time Zone W. Europe Standard Time
Total Physical Memory 512.50 MB
Available Physical Memory 264.24 MB
Total Virtual Memory 1.69 GB
Available Virtual Memory 1.26 GB
Page File Space 1.20 GB
Page File D:\pagefile.sys





W2K:
Quote:


OS Name Microsoft Windows 2000 Advanced Server
Version 5.0.2195 Service Pack 3 Build 2195
OS Manufacturer Microsoft Corporation
System Name SERVER1
System Manufacturer Compaq
System Model ProLiant ML370 G3
System Type X86-based PC
Processor x86 Family 15 Model 2 Stepping 7 GenuineIntel ~2780 Mhz
Processor x86 Family 15 Model 2 Stepping 7 GenuineIntel ~2780 Mhz
Processor x86 Family 15 Model 2 Stepping 7 GenuineIntel ~2780 Mhz
Processor x86 Family 15 Model 2 Stepping 7 GenuineIntel ~2780 Mhz
BIOS Version/Date Compaq P28, 1/8/2003
SMBIOS Version 2.3
Windows Directory C:\WINNT
System Directory C:\WINNT\system32
Boot Device \Device\Harddisk0\Partition1
Locale United States
Hardware Abstraction Layer Version = "5.00.2195.5201"
User Name Domain\admin
Time Zone W. Europe Standard Time
Total Physical Memory 2,560.00 MB
Available Physical Memory 797.78 MB
Total Virtual Memory 8.24 GB
Available Virtual Memory 4.79 GB
Page File Space 5.74 GB
Page File C:\pagefile.sys







Edited by Co (2004-01-27 04:12 PM)
_________________________
Co