Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Runs McAfee MFERemoval100.exe with a valid date for the uninstaller. Tested with Q1 2018 uninstaller. In my use case I used PS1_to_EXE to package the uninstaller and script together and run silently.
if ( -not (Test-Path "$env:ProgramW6432\McAfee") -and -not(Test-Path "${env:ProgramFiles(x86)}\McAfee") ) { exit 0 }
$OriginalDate = Get-Date
# Set the date back to allow MFERemoval to run
Set-Date -Date '01/01/2018'
# Run removal tool
Start-Process -FilePath "$PWD\MFERemoval100.exe" -ArgumentList '/noreboot','/q','/all','/force' -Wait
# Revert the date
Set-Date -Date $OriginalDate
# Sync the time
Start-Process -FilePath W32tm.exe -ArgumentList '/resync','/force' -Wait
if ( -not (Test-Path "$env:ProgramW6432\McAfee") -and -not(Test-Path "${env:ProgramFiles(x86)}\McAfee") ) { exit 3010 }
exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment