Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")
Set objNetwork = CreateObject("WScript.Network")
Const intForAppending = 8
'Log path
strLogFile = "\\indsm\Logs\AVInstallation.log"
'If we are using as a startup script then change the "Alsvc.e1xe" to "Alsvc.exe"
'it checks for the path if not available reinstall's the Sophos or install if not already there
If objFSO.FileExists ("C:\Program Files\Sophos\AutoUpdate\ALsv1c.exe") then
strResults = Now & " - " & objNetwork.ComputerName & ": Already installed."
Else
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSystemInfo = objWMIService.ExecQuery _
("Select Caption from Win32_OperatingSystem",,48)
For Each objItem In colSystemInfo
strOS_Caption = objItem.Caption
Next
If InStr(strOS_Caption, "Windows NT") = 0 Then
'Need to change the Sid path as per version. Silently uninstall the old ver and do not restart
objShell.Run ("MsiExec.exe /X {034759DA-E21A-4795-BFB3-C66D17FAD183} /QN /NORESTART"), 1, True
'Install from the below path
'Username and password mentioned
objShell.Run("\\IND\SophosUpdate\CIDs\S000\SAVSCFXP\Setup.exe -s " & _
"-updp ""\\IND\SophosUpdate\CIDs\S000\SAVSCFXP"" " & _
"-user ""emr2"" " & _
"-pwd ""ab23"" " & _
"-mng yes"),1,True
strResults = Now & " - " & objNetwork.ComputerName & ": Installed version for all other OS's"
Else
objShell.Run("\\IND\SophosUpdate\CIDs\S000\ESNT\Setup.exe -s"), 1, True
strResults = Now & " - " & objNetwork.ComputerName & ": Installed Windows NT version"
End If
End If
Set objLogFile = objFSO.OpenTextFile(strLogFile, intForAppending, True)
objLogFile.WriteLine strResults
objLogFile.Close
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")
Set objNetwork = CreateObject("WScript.Network")
Const intForAppending = 8
'Log path
count = 0
If objFSO.FolderExists(C:\Program files\Sophos) Then
count = count +1
End If
If objFSO.FolderExists(C:\Program files\123) Then
count = count +1
End If
strLogFile = "\\indsm\Logs\AVInstallation.log"
'If we are using as a startup script then change the "Alsvc.e1xe" to "Alsvc.exe"
'it checks for the path if not available reinstall's the Sophos or install if not already there
If objFSO.FileExists ("C:\Program Files\Sophos\AutoUpdate\ALsv1c.exe") then
count = count + 1
Else
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSystemInfo = objWMIService.ExecQuery _
("Select Caption from Win32_OperatingSystem",,48)
For Each objItem In colSystemInfo
strOS_Caption = objItem.Caption
Next
If count = 3 Then
If InStr(strOS_Caption, "Windows NT") = 0 Then
'Need to change the Sid path as per version. Silently uninstall the old ver and do not restart
objShell.Run ("MsiExec.exe /X {034759DA-E21A-4795-BFB3-C66D17FAD183} /QN /NORESTART"), 1, True
'Install from the below path
'Username and password mentioned
objShell.Run("\\IND\SophosUpdate\CIDs\S000\SAVSCFXP\Setup.exe -s " & _
"-updp ""\\IND\SophosUpdate\CIDs\S000\SAVSCFXP"" " & _
"-user ""emr2"" " & _
"-pwd ""ab23"" " & _
"-mng yes"),1,True
strResults = Now & " - " & objNetwork.ComputerName & ": Installed version for all other OS's"
Else
objShell.Run("\\IND\SophosUpdate\CIDs\S000\ESNT\Setup.exe -s"), 1, True
strResults = Now & " - " & objNetwork.ComputerName & ": Installed Windows NT version"
End If
Else
strResults = Now & " - " & objNetwork.ComputerName & ": Already installed."
End If
End If
Set objLogFile = objFSO.OpenTextFile(strLogFile, intForAppending, True)
objLogFile.WriteLine strResults
objLogFile.Close
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")
Set objNetwork = CreateObject("WScript.Network")
Const intForAppending = 8
'Log path
count = 0
If objFSO.FolderExists("C:\Program files\Sophos") Then
count = count +1
End If
If objFSO.FolderExists("C:\Program files\123") Then
count = count +1
End If
strLogFile = "\\indsm\Logs\AVInstallation.log"
'If we are using as a startup script then change the "Alsvc.e1xe" to "Alsvc.exe"
'it checks for the path if not available reinstall's the Sophos or install if not already there
If objFSO.FileExists ("C:\Program Files\Sophos\AutoUpdate\ALsv1c.exe") then
count = count + 1
Else
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSystemInfo = objWMIService.ExecQuery _
("Select Caption from Win32_OperatingSystem",,48)
For Each objItem In colSystemInfo
strOS_Caption = objItem.Caption
Next
If count <> 3 Then
If InStr(strOS_Caption, "Windows NT") = 0 Then
'Need to change the Sid path as per version. Silently uninstall the old ver and do not restart
objShell.Run ("MsiExec.exe /X {034759DA-E21A-4795-BFB3-C66D17FAD183} /QN /NORESTART"), 1, True
'Install from the below path
'Username and password mentioned
objShell.Run("\\IND\SophosUpdate\CIDs\S000\SAVSCFXP\Setup.exe -s " & _
"-updp ""\\IND\SophosUpdate\CIDs\S000\SAVSCFXP"" " & _
"-user ""emr2"" " & _
"-pwd ""ab23"" " & _
"-mng yes"),1,True
strResults = Now & " - " & objNetwork.ComputerName & ": Installed version for all other OS's"
Else
objShell.Run("\\IND\SophosUpdate\CIDs\S000\ESNT\Setup.exe -s"), 1, True
strResults = Now & " - " & objNetwork.ComputerName & ": Installed Windows NT version"
End If
Else
strResults = Now & " - " & objNetwork.ComputerName & ": Already installed."
End If
End If
Set objLogFile = objFSO.OpenTextFile(strLogFile, intForAppending, True)
objLogFile.WriteLine strResults
objLogFile.Close
Open in new window