cancel
Showing results for 
Search instead for 
Did you mean: 

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\"

4 Replies
McAfee Employee wwarren
McAfee Employee
Report Inappropriate Content
Message 2 of 5

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

There is a KB on how to remove the product manually.

If you want to automate this yourself, then go for it.

Support has a tool that automates that process already though, called VSECleaner.

It may have some limitations, corner case scenarios it doesn't handle etc, but if those get reported on through to us then we can look into improving the tool further.

William W. Warren | S.I.R.R. | Customer Success Group | McAfee

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

Hi everyone,

@wwarren: Is this tool available for public download?

@Mark Bose: I updated your script with many more registry keys found in the KB for manually removing, https://kc.mcafee.com/corporate/index?page=content&id=kb59996, but it didn't work for me, so I looked in the registry and found 4 more, and that did the job. Attached to this reply is your updated script.

thanks.

As always, run it at wour own risk. Rename to .bat

regards,

Jorge

on 30/07/12 4:15:48 CDT
McAfee Employee wwarren
McAfee Employee
Report Inappropriate Content
Message 4 of 5

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

@wwarren: Is this tool available for public download?

It is only available from McAfee Support, called VSE Cleaner.

William W. Warren | S.I.R.R. | Customer Success Group | McAfee
McAfee Employee moekhass
McAfee Employee
Report Inappropriate Content
Message 5 of 5

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

simple batch scripts are STILL useful. This will look for the frminst.exe file and proceed in modifying agent from managed to unamanged. As usually the case, please change/tweak to fit your environment/agent version. i tested with MA5. should work with MA4 also.

@echo off

ECHO McAfee Agent Removal Script by Moe Hassan

if exist "%ProgramFiles(x86)%\McAfee\Common Framework\x86\frminst.exe" (GOTO :remove86) ELSE (GOTO :remove64)

:remove86

"%ProgramFiles(x86)%\McAfee\Common Framework\x86\frminst.exe" /Remove=Agent

:remove64

"%ProgramFiles%\McAfee\Agent\x86\frminst.exe" /Remove=Agent

More McAfee Tools to Help You
  • Subscription Service Notification (SNS)
  • How-to: Endpoint Removal Tool
  • Support: Endpoint Security
  • eSupport: Policy Orchestrator
  • Community Help Hub

      New to the forums or need help finding your way around the forums? There's a whole hub of community resources to help you.

    • Find Forum FAQs
    • Learn How to Earn Badges
    • Ask for Help
    Go to Community Help

    Join the Community

      Thousands of customers use the McAfee Community for peer-to-peer and expert product support. Enjoy these benefits with a free membership:

    • Get helpful solutions from McAfee experts.
    • Stay connected to product conversations that matter to you.
    • Participate in product groups led by McAfee employees.
    Join the Community
    Join the Community