美文网首页
右击加入"管理员权限运行cmd"

右击加入"管理员权限运行cmd"

作者: cracker_zhou | 来源:发表于2018-06-24 17:57 被阅读0次

我们知道,当按住shift键并选中某个文件夹或在桌面右击时,会出现在此处打开命令提示符或者在此处打开powershell的选项,但是事实上有些时候我们需要在某个文件夹下打开具有管理员权限的cmd窗口,所以就有了以下技巧。

  1. 右键添加管理员权限的cmd
    原文来自: https://superuser.com/questions/135501/easiest-way-to-get-right-click-open-command-window-here-with-admin-priveleges
Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\Directory\shell\runas]

[HKEY_CLASSES_ROOT\Directory\shell\runas]
@="ElevatedCMD"
"HasLUAShield"=""

[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@="cmd.exe /s /k pushd \"%V\""

[-HKEY_CLASSES_ROOT\Directory\Background\shell\runas]

[HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
@="ElevatedCMD"
"HasLUAShield"=""

[HKEY_CLASSES_ROOT\Directory\Background\shell\runas\command]
@="cmd.exe /s /k pushd \"%V\""

[-HKEY_CLASSES_ROOT\Drive\shell\runas]

[HKEY_CLASSES_ROOT\Drive\shell\runas]
@="ElevatedCMD"
"HasLUAShield"=""

[HKEY_CLASSES_ROOT\Drive\shell\runas\command]
@="cmd.exe /s /k pushd \"%V\""

[HKEY_CLASSES_ROOT\LibraryFolder\background\shell]
@="none"

[HKEY_CLASSES_ROOT\LibraryFolder\background\shell\runas]
@="ElevatedCMD"
"HasLUAShield"=""

[HKEY_CLASSES_ROOT\LibraryFolder\background\shell\runas\command]
@="cmd.exe /s /k pushd \"%V\""

桌面右击效果图(无需按住shift键):


  1. 关闭UAC提示(此处有风险,一般不建议)
    经过第一步后,可以在任意文件夹或者桌面右击选择 ElevatedCMD打开具有管理员权限的cmd,但是很明显还是会弹出一个提示框,这个提示框还是很麻烦的,每次要多点一下。所以我个人关闭了UAC提示。
    最简单的直接按win键然后搜索 UAC关键词即可,在弹出的页面直接选到Never Notify即可

    如果通过win键搜索找不到的,百度还有很多很详细的教程。这里不赘述。

相关文章

网友评论

      本文标题:右击加入"管理员权限运行cmd"

      本文链接:https://www.haomeiwen.com/subject/glrsyftx.html