In case you want to use bash file, it is recommended to use Windows Subsystem for Linux instead.
It is not recommended to ingrate bash with Windows Registry directly because it is unsupported scenario and might leads to other issues.
Is it safe to use %w
nkgc
1
Reputation point
Hi.
I wanted to open .sh file with windows terminal. So I changed my registry.
[HKCR\.sh]
@ = sh_auto_file
[HKCR\sh_auto_file\shell\open\command]
@ = "C:\Users\rlcks\AppData\Local\Microsoft\WindowsApps\wt.exe" -p "Command Prompt" "C:\Program Files\Git\bin\bash.exe" "%L" %*
But this registry open .sh file in my home directory not a directory where the file is. So I changed my registry once more.
[HKCR\sh_auto_file\shell\open\command]
@ = "C:\Users\rlcks\AppData\Local\Microsoft\WindowsApps\wt.exe" -d "%w" -p "Command Prompt" "C:\Program Files\Git\bin\bash.exe" "%L" %*
This registry work fine. But I've heard that %w value doesn't always exists and may cause critical errors.
Is it safe to use this registry?
My windows is windows 10 build 19041.508.
1 answer
Sort by: Most helpful
-
Reza-Ameri 16,836 Reputation points
2021-01-31T16:18:33.64+00:00