在后台目录中打开PowerShell

时间:2015-01-16 20:46:02

标签: powershell registry regedit registrykey

我一直在尝试创建一些注册表项来打开PowerShell,就像按下 Ctrl + Shift + 右键单击

我在这里创建了上下文密钥:

<code>HKLM\Directory\Background\shell\Powershell</code>

但是我放在这里的价值:

<code>HKLM\Directory\Background\shell\Powershell\command</code>

单击Open PowerShell here

时,

会返回错误

"Open PowerShell here" context menu Error message: "This file does not have a program associated with it for performing this action. Please install a program or, if one is already installed, create an association in the Default Programs control panel."

我现在尝试了一些字符串值,但仍然有类似的结果。有没有人使用后台目录键完成此操作,如果是这样,你是怎么做到的?

1 个答案:

答案 0 :(得分:2)

您需要使用%V代替%1

更改默认值,如下所示:

"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoExit "cd '%V'"