Adding Powershell command to right click menu both on and in a folder
Here is the solution:
This adds powershell to the opening window (i.e. when right click on a file)
[HKEY_CLASSES_ROOT\Directory\shell]
1. Create a key such as "powershell" or whatever you want without space
2. Set the default value of the key as your desired text, e.g.:"PS here dear"
3. Create a nested key inside the "powershell" key as "command"
4. Edit the command value by this:
C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -NoExit -NoProfile -Command Set-Location -LiteralPath '%L'
This adds powershell to right click menu inside the folder
[HKEY_CLASSES_ROOT\Directory\Background\shell]
1. Create a key such as "powershell" or whatever you want withuout space
2. Set the default value of the key as your desired text e.g "PS here dear"
3. Create a nested key inside the "powershell" key as "command"
4. Edit the command value by this:
C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -NoExit -NoProfile -Command Set-Location -LiteralPath '%V'
Note to %V and %L differences in the command
This is SdidS's solution as a regedit file:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\powershell_here]
@="PowerShell Here"
[HKEY_CLASSES_ROOT\Directory\Background\shell\powershell_here\command]
@="C:\\\\Windows\\\\system32\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe -NoExit -NoProfile -Command Set-Location -LiteralPath '%V'"