Timmo
Timmo

Reputation: 2334

Open PowerShell here in background directory

I have been trying to create some registry keys to open PowerShell as you would Command Prompt in explorer by pressing Ctrl+Shift+Right Click.

I have the context key created here:

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

but the value I put here:

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

returns an error when I click 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."

I've tried a few string values now but still with similar results. Has anyone accomplished this using the background directory key and if so how did you do it?

Upvotes: 0

Views: 642

Answers (1)

MatthewG
MatthewG

Reputation: 9303

You will want to use %V instead of %1.

Change the Default value like so:

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

Upvotes: 2

Related Questions