Ips*_*gle 9 windows-7 powershell batch-file
默认情况下,我希望在运行批处理文件或“在此处打开命令窗口”等时启动 PowerShell 而不是命令。
有什么建议?
我刚刚做了一个非常快速的测试,以下注册表项将在资源管理器中所有文件夹的上下文菜单中添加一个“PowerShell here”项:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\PowerShellHere]
@="&PowerShell here"
[HKEY_CLASSES_ROOT\Directory\shell\PowerShellHere\command]
@="cmd.exe /c start \"PS\" powershell.exe -NoExit -Command \"cd \\\"%1\\\"\""
Run Code Online (Sandbox Code Playgroud)
只需将其导入注册表即可。我正在使用cmd.exe引导 powershell 以避免必须对路径进行硬编码。
关于 cmd 脚本/批处理文件。我认为默认情况下在 PowerShell 中运行 CMD 脚本没有多大意义。但也可以通过修改HKCR\cmdfile\shell\open注册表项
| 归档时间: |
|
| 查看次数: |
10121 次 |
| 最近记录: |