Advertisement
FreeBooter

RunAsAdminVbs

Nov 14th, 2016
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 2.03 KB | None | 0 0
  1. :: Created by FreeBooter
  2. @Echo Off
  3. Title Dost-Tech.com
  4. Cd %systemroot%\system32
  5. Call :IsAdmin
  6.  
  7.  
  8.  
  9.  
  10. :_Start
  11. Cls & Mode CON  LINES=11 COLS=85 & Color 0D &Title Created By FreeBooter
  12. Echo.
  13. Echo       ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
  14. Echo       º Type (A) to Add Run as administrator context menu item to VBS files     º  
  15. Echo       ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
  16. Echo.
  17. Echo.
  18. Echo       ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»  
  19. Echo       º Type (R) to Remove Run as administrator context menu item to VBS files  º  
  20. Echo       ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ  
  21.  
  22.  
  23. Echo.
  24. Set /p input= RESPONSE:
  25. If /i  Not %input%==R (Goto :_Ex) Else (Goto :_Remove)
  26.  
  27. :_Ex
  28. If /i  Not %input%==A  (Goto :_Start) Else (Goto :_Add)
  29.  
  30.  
  31. :: Add Run as administrator context menu item to VBS files
  32. :_Add
  33. Reg Add HKEY_CLASSES_ROOT\VBSFile\shell\runas\command /ve /t REG_SZ /d "C:\Windows\System32\WScript.exe \"%%1\" %%*"  /f
  34.  
  35.  
  36.  
  37. Cls & Mode CON  LINES=5 COLS=48 & Color 0E
  38.  Echo.
  39.  Echo.
  40.  Echo                     FINNISH
  41.  
  42. Ping -n 5  localhost > Nul
  43. Exit
  44.  
  45.  
  46.  
  47.  
  48. :: Remove Run as administrator context menu item to VBS files
  49. :_Remove
  50. Reg Delete "HKEY_CLASSES_ROOT\VBSFile\shell\runas" /f
  51.  
  52. Cls & Mode CON  LINES=5 COLS=48 & Color 0E
  53.  Echo.
  54.  Echo.
  55.  Echo                     FINNISH
  56.  
  57. Ping -n 5  localhost > Nul
  58. Exit
  59.  
  60.  
  61.  
  62.  
  63. :IsAdmin
  64. Reg query "HKU\S-1-5-19\Environment"
  65. If Not %ERRORLEVEL% EQU 0 (
  66.  Cls & Mode CON  LINES=5 COLS=48 & Color 0C & Title - WARNING -
  67.  Echo.
  68.  Echo.
  69.  Echo  YOU MUST HAVE ADMINISTRATOR RIGHTS TO CONTINUE
  70.  Pause > Nul & Exit
  71. )
  72. Cls
  73. goto:eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement