Windows Registry Editor Version 5.00

; Created by:Shawn Brink
; Created on: August 13, 2016
; Updated on: December 20, 2023
; Tutorial: https://www.tenforums.com/tutorials/60177-add-open-powershell-window-here-administrator-windows-10-a.html

[HKEY_CLASSES_ROOT\Directory\Background\shell\PowerShellAsAdmin]
@="Open PowerShell window here as administrator"
"Extended"=-
"HasLUAShield"=""
"Icon"="powershell.exe"

[HKEY_CLASSES_ROOT\Directory\Background\shell\PowerShellAsAdmin\command]
@="cmd /c reg add hkcu\\software\\_dir /d \"%v\" /f & start powershell -WindowS H -noP -c Start-Process -v RunAs powershell.exe '-noL -noE -c cd -literalP (gp hkcu:\\software\\_dir).\\\"\\\"\\\"(default)\\\"\\\"\\\"; ri hkcu:\\software\\_dir'"


[HKEY_CLASSES_ROOT\Directory\shell\PowerShellAsAdmin]
@="Open PowerShell window here as administrator"
"Extended"=-
"HasLUAShield"=""
"Icon"="powershell.exe"

[HKEY_CLASSES_ROOT\Directory\shell\PowerShellAsAdmin\command]
@="cmd /c reg add hkcu\\software\\_dir /d \"%v\" /f & start powershell -WindowS H -noP -c Start-Process -v RunAs powershell.exe '-noL -noE -c cd -literalP (gp hkcu:\\software\\_dir).\\\"\\\"\\\"(default)\\\"\\\"\\\"; ri hkcu:\\software\\_dir'"


[HKEY_CLASSES_ROOT\Drive\shell\PowerShellAsAdmin]
@="Open PowerShell window here as administrator"
"Extended"=-
"HasLUAShield"=""
"Icon"="powershell.exe"

[HKEY_CLASSES_ROOT\Drive\shell\PowerShellAsAdmin\command]
@="cmd /c reg add hkcu\\software\\_dir /d \"%v\" /f & start powershell -WindowS H -noP -c Start-Process -v RunAs powershell.exe '-noL -noE -c cd -literalP (gp hkcu:\\software\\_dir).\\\"\\\"\\\"(default)\\\"\\\"\\\"; ri hkcu:\\software\\_dir'"


[-HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\PowerShellAsAdmin]


; To allow mapped drives to be available in elevated PowerShell
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
"EnableLinkedConnections"=dword:00000001