4 Replies Latest reply on Jan 31, 2017 1:09 PM by Moe Hassan

    My script to unistall old versions and reinstall new is almost  right any ideas?

      Hi,

      I am working on a script to uninstall old of the "old" agent and VSE software on the workstations and am having a couple of sticking points:

      The line rd /q/s "C:\Program Files\McAfee\" is giving me and access denied error and wont allow me to delete the directory until after a reboot, that is not a working solution.  any ideas?

      Any suggestions for improvement are greatly appreciated, I am very new to scripts.  I will be adding the install of the agent 4.6 and VSE 8.8 At the end along with a bunch of paramaters to not install it on servers initially.

      We are currently running agent 3.6.0.574 and VSE 8.5i.

      Thanks

       

       

       

      @ECHO OFF

      REM McAfee Removal Script

      REM Last Update: 04/11/2012

       

      REM removing the McAfee Agent

       

      ECHO Removing the EPO 2.5 Agent, if present. Please be patient (may take 2-3 minutes)

      if exist %SystemDrive%\epoagent\*.* %SystemDrive%\epoagent\aginst32.exe /remove

       

       

      ECHO Removing the EPO 3.x Agent, if present. Please be patient (may take 2-3 minutes)

      if exist "%ProgramFiles%\network associates\common framework\*.*" "%ProgramFiles%\network associates\common framework\frminst.exe" /remove=agent /s

       

      ECHO Removing the EPO 4.x Agent, if present. Please be patient (may take 2-3 minutes)

      if exist "%ProgramFiles%\mcafee\common framework\*.*" "%ProgramFiles%\McAfee\Common Framework\frminst.exe" /Remove=Agent /Silent

       

      ECHO Remove McAfee Agent

      if exist "%ProgramFiles%\McAfee\Common Framework\frminst.exe" /forceuninstall /silent

       

      REM Removing old versions of VSE

       

      ECHO Removing VirusScan Enterprise 7.0

      msiexec.exe /x {1912F734-6580-4620-8AFD-ECCCEA19CDE2} REMOVE=ALL REBOOT=R /q

       

      ECHO Removing VirusScan Enterprise 7.1

      msiexec.exe /x {59224777-298D-4E9C-9AEB-4A91BDA01B27} REMOVE=ALL REBOOT=R /q

       

      ECHO Removing VirusScan 8.0

      msiexec.exe /x {5DF3D1BB-894E-4DCD-8275-159AC9829B43} REMOVE=ALL REBOOT=R /q

       

      ECHO Removing VirusScan 8.5

      msiexec.exe /x {35C03C04-3F1F-42C2-A989-A757EE691F65} REMOVE=ALL REBOOT=R /q

       

      ECHO Removing VirusScan 8.7

      msiexec.exe /x {147BCE03-C0F1-4C9F-8157-6A89B6D2D973} REMOVE=ALL REBOOT=R /q

       

      REM above line creates error: '/forceuninstall' is not recognized as an internal or external command,

      operable program or batch file.

       

      if exist "%ProgramFiles%(x86)\McAfee\Common Framework\frminst.exe" /forceuninstall /silent

      if exist "%ProgramFiles%\Network Associates\Common Framework\frminst.exe" /forceuninstall /silent

      if exist "%ProgramFiles%\Network Associates\Common Framework\frminst.exe" /forceuninstall /silent

       

      REM Remove McAfee Registry Keys

      ECHO Removing Registry Keys

      REG DELETE HKLM\SYSTEM\CurrentControlSet\services\McShield /f

      REG DELETE HKLM\SYSTEM\CurrentControlSet\services\McTaskManager /f

      REG DELETE HKLM\SYSTEM\CurrentControlSet\Services\mfeapfk /f

      REG DELETE HKLM\SYSTEM\CurrentControlSet\Services\mfeavfk /f

      REG DELETE HKLM\SYSTEM\CurrentControlSet\Services\mfebopk /f

      REG DELETE HKLM\SYSTEM\CurrentControlSet\Services\mfehidk /f

      REG DELETE HKLM\SYSTEM\CurrentControlSet\Services\mferkdet /f

      REG DELETE HKLM\SYSTEM\CurrentControlSet\Services\mfetdik /f

      REG DELETE HKLM\SYSTEM\CurrentControlSet\Services\mfevtp /f

      REG DELETE HKLM\SOFTWARE\McAfee /f

       

      ECHO Killing processes

      taskkill.exe /f /t /im mctray.exe

      taskkill.exe /f /t /im mfevtps.exe

      taskkill.exe /f /t /im FrameworkService.exe

      taskkill.exe /f /t /im naPrdMgr.exe

       

       

      REM Removing Mcafee and agendt directories added by mab 4/10/2012

      rd /q/s "C:\Program Files\McAfee\"

      rd /q/s "C:\Program Files\Network Associates\"

      rd /q/s "C:\EPOAgent"

      rd /q/s "C:\Documents and Settings\All Users\Application Data\McAfee\"