Skip to content

Instantly share code, notes, and snippets.

@guiliredu
Last active September 25, 2017 12:17
Show Gist options
  • Save guiliredu/fa6bd230bcde5b3106cf7a022290d050 to your computer and use it in GitHub Desktop.
Save guiliredu/fa6bd230bcde5b3106cf7a022290d050 to your computer and use it in GitHub Desktop.
sudo.bat - simulate sudo command in windows
:: Save this file in C:\Windows or another folder in your $TEMP
@echo Set objShell = CreateObject("Shell.Application") > %temp%\sudo.tmp.vbs
@echo args = Right("%*", (Len("%*") - Len("%1"))) >> %temp%\sudo.tmp.vbs
@echo objShell.ShellExecute "%1", args, "", "runas" >> %temp%\sudo.tmp.vbs
@cscript %temp%\sudo.tmp.vbs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment