Win10系统右键添加Powershell和命令提示符方法
在Win10系统中,我们可以通过按下SHIFT键加右键来呼出右键菜单中的Powershell控制台选项。然而,对于那些经常需要进行操作的用户来说,这种方式可能有些繁琐。下面我将分享一种方法,可以让我们无需按下Shift键就能直接使用Powershell控制台选项。
首先,我们需要删除原有的注册表项,包括`-HKEY_CLASSES_ROOTDirectoryBackgroundshellOpenCmdHere`、`-HKEY_CLASSES_ROOTDirectoryBackgroundshell unas`和`-HKEY_CLASSES_ROOTDirectoryBackgroundshellPowershellAdmin`。
接下来,我们按照以下步骤进行设置:
1. 右键点击空白处:命令行
[HKEY_CLASSES_ROOTDirectoryBackgroundshellOpenCmdHere]
@=“在此处打开命令行窗口”
[HKEY_CLASSES_ROOTDirectoryBackgroundshellOpenCmdHerecommand]
@=“cmd.exe-noexit-commandSet-Location-literalPath”%V“”
2. 右键点击空白处:命令行(管理员)
[HKEY_CLASSES_ROOTDirectoryBackgroundshell unas]
@=“在此处打开命令行窗口(管理员)”
“ShowBasedOnVelocityId”=dword:00639bc8
[HKEY_CLASSES_ROOTDirectoryBackgroundshell unascommand]
@=“cmd.exe/s/kpushd”%V“”
3. 按下SHIFT键加右键:Powershell(管理员)
[HKEY_CLASSES_ROOTDirectoryBackgroundshellPowershellAdmin]
@=“在此处打开Powershell窗口(管理员)”
“Extended”=“”
[HKEY_CLASSES_ROOTDirectoryBackgroundshellPowershellAdmincommand]
@=“”C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe“-windowstylehidden-Command$stpath=pwd;Start-ProcessPowerShell-ArgumentList\”-NoExit\“,\”-CommandSet-Location-literalPath‘%V’\“-verbRunAs”
4. 设置右键管理员打开命令行的另一种方法(可用来替换上述第2步)
通过Powershell调用,会有一次Powershell窗口的闪现。去掉以下几行的分号`[;]`来取消注释。
[-HKEY_CLASSES_ROOTDirectoryBackgroundshellOpenCmdHereAdmin]
[HKEY_CLASSES_ROOTDirectoryBackgroundshellOpenCmdHereAdmin]
@=“在此处打开命令行窗口(管理员)”
[HKEY_CLASSES_ROOTDirectoryBackgroundshellOpenCmdHereAdmincommand]
@=“PowerShell-windowstylehidden-Command”Start-Processcmd.exe-ArgumentList‘/s,/k,pushd,%V’-VerbRunAs“”
通过以上设置,我们可以更方便地使用右键菜单中的Powershell控制台选项,提高操作效率。希望以上内容能对你有所帮助!
常见问题
- win11关机一直提示有程序阻止关机怎么解决?
- kingsoft是什么文件夹?教你kingsoft如何删除
- 电脑开机提示reboot and select proper boot device解决方法大全
- Win10专业工作站版和专业版区别,哪个更好用?看评测!
- Win7原版|MSDN Windows7 SP1官方原版ISO镜像下载(全版本)
- win10字体发虚模糊正确解决方法(5个方法)
- 怎么关闭睿频?关闭睿频让CPU性能更稳定温度更低!
- 电脑Default Boot Device Missing or Boot Failed解决方法
- Win10以太网连接速度只有10M如何解决?
- chsime.exe是什么进程,可以删除吗