Windows Registry Editor Version 5.00

; Created by: Shawn Brink
; Created on: August 10, 2016
; Updated on: January 26, 2021
; Tutorial: https://www.tenforums.com/tutorials/59686-open-command-window-here-administrator-add-windows-10-a.html



[HKEY_CLASSES_ROOT\Directory\shell\OpenCmdHereAsAdmin]
@="Open command window here as administrator"
"Extended"=""
"Icon"="imageres.dll,-5324"

[HKEY_CLASSES_ROOT\Directory\shell\OpenCmdHereAsAdmin\command]
@="cmd /c echo|set/p=\"%L\"|powershell -NoP -W 1 -NonI -NoL \"SaPs 'cmd' -Args '/c \"\"\"cd /d',$([char]34+$Input+[char]34),'^&^& start /b cmd.exe\"\"\"' -Verb RunAs\""



[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHereAsAdmin]
@="Open command window here as administrator"
"Extended"=""
"Icon"="imageres.dll,-5324"

[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHereAsAdmin\command]
@="cmd /c echo|set/p=\"%V\"|powershell -NoP -W 1 -NonI -NoL \"SaPs 'cmd' -Args '/c \"\"\"cd /d',$([char]34+$Input+[char]34),'^&^& start /b cmd.exe\"\"\"' -Verb RunAs\""



[HKEY_CLASSES_ROOT\Drive\shell\OpenCmdHereAsAdmin]
@="Open command window here as administrator"
"Extended"=""
"Icon"="imageres.dll,-5324"

[HKEY_CLASSES_ROOT\Drive\shell\OpenCmdHereAsAdmin\command]
@="cmd /c echo|set/p=\"%L\"|powershell -NoP -W 1 -NonI -NoL \"SaPs 'cmd' -Args '/c \"\"\"cd /d',$([char]34+$Input+[char]34),'^&^& start /b cmd.exe\"\"\"' -Verb RunAs\""



[-HKEY_CLASSES_ROOT\LibraryFolder\background\shell\OpenCmdHereAsAdmin]



; To allow mapped drives to be available in command prompt
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
"EnableLinkedConnections"=dword:00000001
