'------------------------------------------------------------------------------' Dim fso : Set fso = CreateObject("Scripting.FileSystemObject") Dim oShell : Set oShell = CreateObject("WScript.Shell") Dim WshNetwork : Set WshNetwork = WScript.CreateObject("WScript.Network") '------------------------------------------------------------------------------' '-- Disk Space Check --' '------------------------------------------------------------------------------' Set objWMI = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\.\root\cimv2") Set objLogicalDisk = objWMI.Get("Win32_LogicalDisk.DeviceID='c:'") strDisksize = objLogicalDisk.FreeSpace/(1024*1024*1024) If strDisksize < 1 Then 'commented out for VM test ' If strDisksize < 5 Then MsgBox "Aborting the SGN installation. 5 GB are required during the install at present there only appears to be " & (strDiskSize \1) _ & " GB Free. Please free up more space and then try again" Wscript.Quit Else 'MsgBox "Drive space good...continuing..." End If '------------------------------------------------------------------------------' '-- Memory Check -- Require minimum 512mb --' '------------------------------------------------------------------------------' Dim objWMIService, objComputer, colComputer Dim strLogonUser, strComputer strComputer = "." Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colComputer = objWMIService.ExecQuery("Select * from Win32_ComputerSystem") For Each objComputer in colComputer ' If (objComputer.TotalPhysicalMemory \1048576) <300 Then ' commented out for VM test If (objComputer.TotalPhysicalMemory /1024*1024) <512 Then MsgBox "Aborting the SGN installation. Not enough memory to continue the installation:" &(objComputer.TotalPhysicalMemory /1024*1024) &"MB" wscript.quit Else 'do nothing' 'MsgBox "all good: "&(objComputer.TotalPhysicalMemory /1024*1024) End If Next '------------------------------------------------------------------------------' '- 5002 prevention '------------------------------------------------------------------------------' Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv") strRenamePath = "SYSTEM\CurrentControlSet\Control\Session Manager" strrenameValue = "PendingFileRenameOperations" oReg.DeleteValue HKEY_LOCAL_MACHINE,strRenamePath,strrenameValue '------------------------------------------------------------------------------' '- Increase IPStack resource '------------------------------------------------------------------------------' dwStackPath = "SYSTEM\CurrentControlSet\Services\lanmanserver\parameters" dwStackName = "IRPStackSize" dwStaveValue = "33" oReg.SetDWordValue HKEY_LOCAL_MACHINE,dwStackPath,dwStackName,dwStaveValue '----------------------------------------------------------------------------' '- Define Variables '----------------------------------------------------------------------------' Dim SGNClientPreinstallMSILocationFile SGNClientPreinstallMSILocationFile = \\itsvr01\Packages\Sophos SafeGuard Disk 32bit & "\SGxClientPreinstall.msi" & Chr(34) Dim SDEClientMSILocationFile SDEClientMSILocationFile = \\itsvr01\Packages\Sophos SafeGuard Disk 32bit & "\sdeclient.msi" & Chr(34) Dim SDEClientConfigMSILocationFile SDEClientConfigMSILocationFile = \\itsvr01\Packages\Sophos SafeGuard Disk 32bit & "\clientpkg.msi" & Chr(34) Dim InstallationLogFileLocation InstallationLogFileLocation = \\itsvr01\Packages\Sophos SafeGuard Disk 32bit '------------------------------------------------------------------------------' '- Installation of SGN Client Pre-Install Client '------------------------------------------------------------------------------' strLaunchCmd = "msiexec /i " & SGNClientPreinstallMSILocationFile & " /passive /L*v c:\" & WshNetwork.ComputerName & "_SGNPIClient.log /norestart" intRetVal = oShell.Run(strLaunchCmd,1,True) '------------------------------------------------------------------------------' '- Installation of SDE Client '------------------------------------------------------------------------------' strLaunchCmd = "msiexec /i " & SDEClientMSILocationFile & " /passive /L*v c:\" & WshNetwork.ComputerName & "_SDEClient.log /norestart" intRetVal = oShell.Run(strLaunchCmd,1,True) '------------------------------------------------------------------------------' '- Complete Installation of Client Configuration File '------------------------------------------------------------------------------' strLaunchCmd = "msiexec /i " & SDEClientConfigMSILocationFile & " /passive /L*v c:\" & WshNetwork.ComputerName & "_SDEclientConfig.log /norestart" intRetVal = oShell.Run(strLaunchCmd,1,True) '------------------------------------------------------------------------------' '-- Schedule CHKDSK /F '------------------------------------------------------------------------------' strLaunchCmd = "chkntfs /t:00" intRetVal = oShell.Run(strLaunchCmd,1,True) strLaunchCmd = "CMD.EXE /C echo Y|Chkdsk.exe C: /F" intRetVal = oShell.Run(strLaunchCmd,1,True) '------------------------------------------------------------------------------' '- Reboot computer '------------------------------------------------------------------------------' Set oWMI = GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown)}!\\.\root\cimv2") For Each obj in oWMI.ExecQuery("Select * from Win32_OperatingSystem") Set oOS = obj Exit For Next oOS.Win32shutdown(2 + 4)