0 Replies Latest reply on Jun 4, 2009 11:40 PM by Dvanmeter

    8.7i Patch 1 Remover

      I had posted this in one of the threads, but thought I repost to make it easier for people to find. If you need to remove Patch 1 from selected machines, you can run the following script remotely from your machine to do so. You must have administrator rights on the remote system and MSI and WMI must be working correctly. Im sure expert scripters could have made prettier but this has worked really well for me. Here is what I posted in one of the threads.

      I wrote this vbscript to remove Patch 1 on remote systems. It does not reboot them, is silent to the user. you need to have access to wmi on the remote system (Should be on by default) and you must have admin rights. Just type the computer name or IP of the system you want to remove it on. The first half of the script checks with a ping that the system is on. If anyone needs this in EXE format I can send or just use WINRAR. Just copy everything between the dashes to a notepad file and save it, then rename the extension from .txt to .vbs

      -------------------------------------------------------------------------------- --------------
      ' Patch 1 Remover for Mcafee 8.7I
      ' Author Daniel VanMeter

      function Ping(byval strName)
      dim objFSO, objShell, objTempFile, objTS
      dim sCommand, sReadLine
      dim bReturn

      set objShell = WScript.CreateObject("Wscript.Shell")
      set objFSO = CreateObject("Scripting.FileSystemObject")

      'Set default return value
      bReturn = false

      'Create command line to ping and save results to a temp file
      sCommand = "cmd /c ping.exe -n 3 -w 1000 " & strName & " > temp.txt"

      'Execute the command
      objShell.run sCommand, 0, true

      'Get the temp file
      set objTempFile = objFSO.GetFile("temp.txt")
      set objTS = objTempFile.OpenAsTextStream(1)

      'Loop through the temp file to see if "reply from" is found,
      'if it is then the ping was successful
      do while objTs.AtEndOfStream <> true
      sReadLine = objTs.ReadLine
      if instr(lcase(sReadLine), "reply from") > 0 then
      bReturn = true
      exit do
      end if

      'Close temp file and release objects
      set objTS = nothing
      set objTempFile = nothing
      set objShell = nothing
      set objFSO = nothing

      'Return value
      Ping = bReturn
      end function
      ' Start the actual process---------
      strExe = "cmd.exe /C %WINDIR%\system32\Msiexec.exe /I {147BCE03-C0F1-4C9F-8157-6A89B6D2D973} MSIPATCHREMOVE={6D622ACA-CAEF-455E-A108-E2953C0683A0} REBOOT=R /q"

      strComputer = (InputBox("Mcafee 8.7I Patch 1 Remover." & vbNewline & " " & vbNewline & "Requirements:" & vbNewline & "1. Access to WMI on remote system." & vbNewline & "2. You must be logged in locally with an account that has admin rights on the remote system." & vbNewline & "3: Patch 1 for Mcafee 8.7I must be installed" & vbNewline & " " & vbNewline & "Please enter a computer name or IP below:" ,_
      "Mcafee 8.7I Patch 1 Remover: Created by Daniel VanMeter"))

      'if Cancel selected - exit
      If (strComputer = "") Then Wscript.Quit

      'ping the computername to see if it is accessible
      bPingtest = ping(strComputer)

      If bPingtest = FALSE Then
      y = msgbox ("'" & StrComputer & "' is not accessible!" & vbCRLF _
      & " " & vbnewline & "The system may be offline or the name" & vbCRLF _
      & "may have been mispelled." & vbCRLF, _
      vbCritical, StrComputer & " NOT RESPONDING")
      end IF

      ' Connect to WMI
      set objWMIService = getobject("winmgmts://"_
      & strComputer & "/root/cimv2")
      ' Obtain the Win32_Process class of object.
      Set objProcess = objWMIService.Get("Win32_Process")
      Set objProgram = objProcess.Methods_( _
      objProgram.CommandLine = strExe

      'Execute the program now at the command line.
      Set strShell = objWMIService.ExecMethod( _
      "Win32_Process", "Create", objProgram)

      WScript.echo "Patch 1 Remover successfully ran on " & strcomputer & ". The computer may take a moment to uninstall the patch."
      ' End of Example of a Process VBScript
      -------------------------------------------------------------------------------- -------------------------

      If you need to do a mass uninstall the core of the script is

      %WINDIR%\system32\Msiexec.exe /I {147BCE03-C0F1-4C9F-8157-6A89B6D2D973} MSIPATCHREMOVE={6D622ACA-CAEF-455E-A108-E2953C0683A0} REBOOT=R /q

      Just run that in a bat file and put it in your login script