Skip to content

Instantly share code, notes, and snippets.

@realslacker
Created April 18, 2018 20:08
Show Gist options
  • Save realslacker/b7966b2d8a2319cc8338e79ba5c1a6e3 to your computer and use it in GitHub Desktop.
Save realslacker/b7966b2d8a2319cc8338e79ba5c1a6e3 to your computer and use it in GitHub Desktop.
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