Advertisement
metalx1000

Windows VBScript that acts like sudo runas admin

Dec 3rd, 2017
817
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #sudo for windows (not really)  //Opens new Window//
  2. #put the following in a file called sudo.cmd
  3. @echo Set objShell = CreateObject("Shell.Application") > %temp%\sudo.tmp.vbs
  4. @echo args = Right("%*", (Len("%*") - Len("%1"))) >> %temp%\sudo.tmp.vbs
  5. @echo objShell.ShellExecute "%1", args, "", "runas" >> %temp%\sudo.tmp.vbs
  6. @cscript %temp%\sudo.tmp.vbs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement