Win10系统右键添加Powershell和命令提示符方法
提升Win10系统操作效率的技巧

在Win10系统中,我们经常需要使用Powershell控制台来进行操作,但是通过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. 右键菜单中添加命令行选项:
在注册表中添加以下内容:
```
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere]
@="在此处打开命令行窗口"
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere\command]
@="cmd.exe /noexit /command Set-Location -literalPath \"%V\""
```
2. 右键菜单中添加命令行(管理员)选项:
在注册表中添加以下内容:
```
[HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
@="在此处打开命令行窗口(管理员)"
"ShowBasedOnVelocityId"=dword:00639bc8
[HKEY_CLASSES_ROOT\Directory\Background\shell\runas\command]
@="cmd.exe /s /k pushd \"%V\""
```
3. Shift+右键菜单中添加Powershell(管理员)选项:
在注册表中添加以下内容:
```
[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\" -windowstyle hidden -Command $stpath=pwd; Start-Process PowerShell -ArgumentList \\\"-NoExit\\\", \\\"-Command Set-Location -literalPath '%V'\\\" -verb RunAs"
```
4. 另一种方法:通过Powershell调起管理员模式的cmd:
在注册表中添加以下内容:
```
[-HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHereAdmin]
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHereAdmin]
@="在此处打开命令行窗口(管理员)"
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHereAdmin\command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd.exe -ArgumentList '/s,/k,pushd,%V' -Verb RunAs\""
```
通过以上方法,你可以轻松地在Win10系统中设置右键菜单中的命令行和Powershell选项,提升操作效率,让你的工作更加便捷。
常见问题
- Win10专业版升级专业工作站版永久激活(图文详细教程)
 - crashdumps文件夹是什么,里面的DMP文件可以删除吗
 - Win10安装最新WDDM2.7驱动及开启硬件加速GPU计划教程
 - Win10 SysMain服务是什么?SysMain能不能禁用?
 - usb composite device是什么,黄色感叹号怎么安装驱动?
 - 玩steam游戏时提示需要the following component(s)are required to run this program如何解决?
 - yundetectservice是什么?yundetectservice.exe进程如何禁止?
 - 教你win10系统指定某个程序不弹出【用户账户控制】的操作方法
 - 格式化分配单元大小是什么意思,分配单元大小多少合适?
 - ThinkPad笔记本按数字4就黑屏睡眠怎么解决?
 







![W11专业版下载|W11系统专业版[永久激活]](https://img.523y.com/2024/0515/434fcc59712e1dee91fe1b57110692e6.png?crop/90x90)


![Win10 ISO镜像下载2024最新|Win10 64位专业版ISO镜像[21H2最新版]](https://img.523y.com/2024/0515/ff736f9a33599a589a7791f89d98b9d1.jpg?crop/90x90)

![Win11正式版镜像下载|Win11正式版系统镜像[64位专业版]](https://img.523y.com/2024/0515/55bf2a86592ff7c57252ebecec1ac277.png?crop/90x90)

![纯净版Win10系统下载|Win10 64位纯净版专业版[永久激活]v2024](https://img.523y.com/2024/0616/aa3cd46af8752af6312a0dfc467d271d.jpg?crop/90x90)
![【Win10系统纯净版下载】Win10纯净专业版64位[永久激活]](https://img.523y.com/2024/0515/bbfad433b0999103ae97fe9477a34b8f.jpg?crop/90x90)


