2
1
Consider the following key, as an example
HKEY_CLASSES_ROOT\txtfile\shell\open\command
and its (Default)
value
%SystemRoot%\system32\NOTEPAD.EXE %1
This value determines what will happen when you double click on a .txt
file.
%SystemRoot%
and %1
are variables that can be interpreted by
cmd.exe
. An equivalent command in PowerShell would look like
$env:SystemRoot\system32\NOTEPAD.EXE $args[0]
However if you set the registry value to the Powershell equivalent it will only create an error, because it is cmd.exe
trying to interpret it, and not PowerShell. Can Windows be set in such a way to allow PowerShell to be the interpreter instead of cmd.exe
?