Guest User

Untitled

a guest
May 28th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. Windows Registry Editor Version 5.00
  2.  
  3. [HKEY_CLASSES_ROOTDirectoryshellrunas]
  4. @="Open Command Window Here as Administrator"
  5.  
  6. [HKEY_CLASSES_ROOTDirectoryshellrunascommand]
  7. @="cmd.exe /s /k pushd "%V""
  8.  
  9. REGEDIT4
  10. [HKEY_CURRENT_USERSoftwareMicrosoftCommand Processor]
  11. "Autorun"="cd /d "%userprofile%""
  12.  
  13. Windows Registry Editor Version 5.00
  14.  
  15. [HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionAppCompatFlagsLayers]
  16. "C:\Windows\System32\cmd.exe"="~ RUNASADMIN"
  17. "C:\Windows\SysWOW64\cmd.exe"="~ RUNASADMIN"
  18.  
  19. [HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionAppCompatFlagsLayers]
  20. "C:\Windows\System32\cmd.exe"="~ RUNASADMIN"
  21. "C:\Windows\SysWOW64\cmd.exe"="~ RUNASADMIN"
  22.  
  23. Windows Registry Editor Version 5.00
  24.  
  25. [HKEY_CLASSES_ROOTDirectoryBackgroundshellcmda]
  26. @="Open command window here (Administrator)"
  27. "HasLUAShield"=""
  28. "Extended"=""
  29.  
  30. [HKEY_CLASSES_ROOTDirectoryBackgroundshellcmdaCommand]
  31. @="cmda.exe /s /k pushd "%V""
  32.  
  33. Windows Registry Editor Version 5.00
  34.  
  35. [HKEY_LOCAL_MACHINESoftwareMicrosoftWindows NTCurrentVersionAppCompatFlagsLayers]
  36. @="C:\Windows\System32\cmd.exe"="RUNASADMIN"
  37.  
  38. Windows Registry Editor Version 5.00
  39. ;write minus before to unreg example: [-HKEY_CLASSES_ROOTDirectoryshellcmdhere]
  40.  
  41. [HKEY_CLASSES_ROOTDirectoryshellcmdhere]
  42. @="Open Command Window Here"
  43.  
  44. [HKEY_CLASSES_ROOTDirectoryshellcmdherecommand]
  45. @="cmd.exe /s /k pushd "%V""
  46.  
  47. [HKEY_CLASSES_ROOTDirectoryBackgroundshellcmdhere]
  48. @="Open Command Window Here"
  49.  
  50. [HKEY_CLASSES_ROOTDirectoryBackgroundshellcmdherecommand]
  51. @="cmd.exe /s /k pushd "%V""
  52.  
  53. [HKEY_CLASSES_ROOTDirectoryshellrunas]
  54. @="Open Command Window Here as Administrator"
  55.  
  56. [HKEY_CLASSES_ROOTDirectoryshellrunascommand]
  57. @="cmd.exe /s /k pushd "%V""
  58.  
  59. [HKEY_CLASSES_ROOTDirectoryBackgroundshellrunas]
  60. @="Open Command Window Here as Administrator"
  61.  
  62. [HKEY_CLASSES_ROOTDirectoryBackgroundshellrunascommand]
  63. @="cmd.exe /s /k pushd "%V""
  64.  
  65. @echo off
  66. :: BatchGotAdmin
  67. :-------------------------------------
  68. REM --> Check for permissions
  69. >nul 2>&1 "%SYSTEMROOT%system32cacls.exe" "%SYSTEMROOT%system32configsystem"
  70.  
  71. REM --> If error flag set, we do not have admin.
  72. if '%errorlevel%' NEQ '0' (
  73. echo Requesting administrative privileges...
  74. goto UACPrompt
  75. ) else ( goto gotAdmin )
  76.  
  77. :UACPrompt
  78. echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%getadmin.vbs"
  79. echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%getadmin.vbs"
  80.  
  81. "%temp%getadmin.vbs"
  82. exit /B
  83.  
  84. :gotAdmin
  85. if exist "%temp%getadmin.vbs" ( del "%temp%getadmin.vbs" )
  86. pushd "%CD%"
  87. CD /D "%~dp0"
  88. :--------------------------------------
Add Comment
Please, Sign In to add comment