跳转到内容
新建笔记

Windows设置右键打开管理员CMD

参考方法:Windows设置右键打开CMD - 知乎 (zhihu.com)

按参考方法创建右键CMD,在command默认项的数值数据中填入

powershell.exe -Command "Start-Process cmd -ArgumentList '/s,/k,pushd \"%V\"' -Verb RunAs"

新建粘贴下面内容到自建的xxx.reg文件,用于创建

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\AdminCmd]
@="管理员命令提示符(&A)"
"Icon"="C:\\Windows\\System32\\cmd.exe"
"HasLUAShield"=""
[HKEY_CLASSES_ROOT\Directory\Background\shell\AdminCmd\command]
@="cmd.exe /s /k \"pushd %V\""
[HKEY_CLASSES_ROOT\Directory\shell\AdminCmd]
@="管理员命令提示符(&A)"
"Icon"="C:\\Windows\\System32\\cmd.exe"
"HasLUAShield"=""
[HKEY_CLASSES_ROOT\Directory\shell\AdminCmd\command]
@="cmd.exe /s /k \"pushd %V\""

新建粘贴下面内容到自建的xxx.reg文件,用于删除

Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Directory\Background\shell\AdminCmd]
[-HKEY_CLASSES_ROOT\Directory\shell\AdminCmd]

来源:CSDN 原文,首次发布于 2024-04-22。