Open Powershell in a specific directory from shortcut

后端 未结 9 1314
再見小時候
再見小時候 2021-01-30 12:22

This sounds like it should be so simple... I must be dumb.

All I want is to make a windows short-cut that opens Powershell into a specific directory:

I\'m using

9条回答
  •  北荒
    北荒 (楼主)
    2021-01-30 13:13

    Copy this code into notepad and save with a reg extension. Double click the resulting file.If you get a message about importing to the registry click on yes and then ok. Navigate to any folder in explorer and bring up the context menu. This is typically done by clicking the right mouse button.


    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\Directory\Background\shell\PShell]
    "MUIVerb"="Open in Powershell Window"
    
    [HKEY_CLASSES_ROOT\Directory\Background\shell\PShell\command]
    @="c:\\windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -NoExit -Command Set-Location -LiteralPath '%V'"
    

提交回复
热议问题