-
Notifications
You must be signed in to change notification settings - Fork 7
/
PowerShell5-here.reg
28 lines (26 loc) · 3.65 KB
/
PowerShell5-here.reg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Windows Registry Editor Version 5.00
; WindowsContextMenuTools created by VincentBounce
;PowerShell v5
[-HKEY_CLASSES_ROOT\Directory\shell\run210PowerShell5]
[HKEY_CLASSES_ROOT\Directory\shell\run210PowerShell5]
;"Extended"="" ;used to view command in context menu only with Shift pushed
"MUIVerb"="&PowerShell 5"
"subcommands"=""
"Icon"="%SystemRoot%\\system32\\WindowsPowerShell\\v1.0\\powershell.exe" ;powershell.exe balone works because C:\WINDOWS\System32\WindowsPowerShell\v1.0\ in %PATH%
;HERE
[HKEY_CLASSES_ROOT\Directory\shell\run210PowerShell5\shell\run00210]
@="Open &here"
"Icon"="%SystemRoot%\\system32\\WindowsPowerShell\\v1.0\\powershell.exe"
[HKEY_CLASSES_ROOT\Directory\shell\run210PowerShell5\shell\run00210\command]
;PowerShell 5 (x64) is called and located in [%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe] confirmed although it's not logical
;PowerShell 5 (x86) is NOT called and located in [%SystemRoot%\syswow64\WindowsPowerShell\v1.0\powershell.exe] confirmed although it's not logical
@="powershell.exe -NoExit -Command \"Set-Location -LiteralPath '%L'; $host.UI.RawUI.WindowTitle = 'PowerShell 5 (x64)'\""
;HERE AS ADMIN
[HKEY_CLASSES_ROOT\Directory\shell\run210PowerShell5\shell\runas]
@="Open here as &Administrator"
"Icon"="%SystemRoot%\\system32\\WindowsPowerShell\\v1.0\\powershell.exe"
"HasLUAShield"=""
[HKEY_CLASSES_ROOT\Directory\shell\run210PowerShell5\shell\runas\command]
@="powershell.exe -NoExit -Command \"Set-Location -LiteralPath '%L'; $host.UI.RawUI.WindowTitle = 'Administrator: PowerShell 5 (x64)'; $host.UI.RawUI.ForegroundColor = 'yellow'\""
;below another command possible without using [runas] regedit key, and using %V instead %L
;@="PowerShell -windowstyle hidden -Command \"Start-Process cmd.exe -ArgumentList '/s,/c,pushd %V && powershell' -Verb RunAs\""