Skip to content

Instantly share code, notes, and snippets.

@phoenixthrush
Last active August 13, 2025 02:06
Show Gist options
  • Select an option

  • Save phoenixthrush/7ca90e08929876bdb76c3902bd2d7607 to your computer and use it in GitHub Desktop.

Select an option

Save phoenixthrush/7ca90e08929876bdb76c3902bd2d7607 to your computer and use it in GitHub Desktop.
Windows Defender History Deletion with UAC Elevation #Batch #RunAsAdmin #WindowsDefender
if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b)
rmdir "C:\ProgramData\Microsoft\Windows Defender\Scans\History" /S /Q >nul 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment