繁体   English   中英

使用Powershell在上下文菜单中添加新项目会出现错误

[英]Add new item in context menu using powershell gives an error

我试图创建一个上下文菜单,但是一旦创建它,​​我会收到一条错误消息,指出该文件没有与之关联的程序。 我正在使用此脚本。 我正在尝试在文件夹上创建Powershell快捷方式。

New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
Test-Path HKCR:\Directory\shell\Powershell
New-Item -Path HKCR:\Directory\shell -Name Powershell
Set-Item -Path HKCR:\Directory\shell\Powershell -Value "Open Powershell Here" 
New-Item -Path HKCR:\Directory\shell\Powershell\key -Value    
"C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -NoExit -Command Set-Location -
LiteralPath '%L'"

尝试更改最后一行:

 New-Item -Path HKCR:\Directory\shell\Powershell\key -Value "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -NoExit -Command ""Set-Location -LiteralPath '%L'"""

如果不起作用,请添加第三个'“” """Set-location...

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM