Created
October 21, 2015 17:00
-
-
Save kapb14/73121937ad36a50de271 to your computer and use it in GitHub Desktop.
simplest "sudo" for Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: save this file as "sudo.cmd" and place it in your %PATH% | |
@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