Win10系统右键添加Powershell和命令提示符方法
更新日期:2024-06-26 13:02
来源:互联网
润色后的文章
在Win10系统中,我们可以通过按下SHIFT键加右键来呼出右键菜单中的Powershell控制台选项。然而,对于那些经常需要进行操作的用户来说,这种方式可能有些繁琐。下面我将分享一种方法,可以让我们无需按下Shift键就能直接使用Powershell控制台选项。
首先,我们需要删除原有的注册表项,包括`-HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere`、`-HKEY_CLASSES_ROOT\Directory\Background\shell\runas`和`-HKEY_CLASSES_ROOT\Directory\Background\shell\PowershellAdmin`。
接下来,我们按照以下步骤进行设置:
1. 右键点击空白处:命令行
```markdown
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere]
@="在此处打开命令行窗口"
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere\command]
@="cmd.exe-noexit-commandSet-Location-literalPath\"%V\""
```
2. 右键点击空白处:命令行(管理员)
```markdown
[HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
@="在此处打开命令行窗口(管理员)"
"ShowBasedOnVelocityId"=dword:00639bc8
[HKEY_CLASSES_ROOT\Directory\Background\shell\runas\command]
@="cmd.exe/s/kpushd\"%V\""
```
3. 按下SHIFT键加右键:Powershell(管理员)
```markdown
[HKEY_CLASSES_ROOT\Directory\Background\shell\PowershellAdmin]
@="在此处打开Powershell窗口(管理员)"
"Extended"=""
[HKEY_CLASSES_ROOT\Directory\Background\shell\PowershellAdmin\command]
@="\"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窗口的闪现。去掉以下几行的分号`[;]`来取消注释。
```markdown
[-HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHereAdmin]
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHereAdmin]
@="在此处打开命令行窗口(管理员)"
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHereAdmin\command]
@="PowerShell-windowstylehidden-Command\"Start-Processcmd.exe-ArgumentList'/s,/k,pushd,%V'-VerbRunAs\""
```
通过以上设置,我们可以更方便地使用右键菜单中的Powershell控制台选项,提高操作效率。希望以上内容能对你有所帮助!
相关下载
【GHOST WIN10系统镜像下载】Win10 64位系统永久激活,高速优化 v2024
查看
W11专业版下载|W11系统专业版[永久激活] V2024
查看
Win7精简版下载|Win7 64位精简旗舰版(超流畅,带USB3.0驱动)v2024
查看
Win11原版系统下载|Win11 64位专业版官方ISO镜像 V2024
查看
Win10 ISO镜像下载2024最新|Win10 64位专业版ISO镜像[21H2最新版]
查看
Windows10精简版下载|Win10 LTSC 2024 64位精简纯净版
查看
Win11正式版镜像下载|Win11正式版系统镜像[64位专业版]
查看
Win11系统下载|Win11 64位正式版专业版原版ISO镜像
查看