On Error Resume Next
strShare = "\\server\share"
strInstaller = strShare & "\Windows-en-US-KB943729.exe"
strLogFolder = strShare & "\logs"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = WScript.CreateObject("WScript.Shell")
strComputerName = objShell.ExpandEnvironmentStrings("%computername%")
If Not objFSO.FolderExists(strSystemRoot & "\" & "$NtUninstallKB943729$") Then
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select Caption From Win32_OperatingSystem")
For Each objItem in colItems
If InStr(objItem.Caption, "Vista") Then
blnVista = True
End If
Next
If Not blnVista Then
objShell.Run strInstaller & " /quiet /passive /norestart", 0, True
If Not objFSO.FolderExists(strLogFolder) Then
objFSO.CreateFolder strLogFolder
End If
Set objReport = objFSO.CreateTextFile(strLogFolder & "\" & strComputerName, True)
objReport.Close
End If
End If
|