windows7 :
按住 shift 键 , 右键 就有该选项。
windows10 :
运行下面的 注册表文件:
该注册表文件内容如下:
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOTDirectoryshell unas] @="Open cmd here as Admin" "HasLUAShield"="" [HKEY_CLASSES_ROOTDirectoryshell unascommand] @="cmd.exe /s /k pushd "%V"" [-HKEY_CLASSES_ROOTDirectoryBackgroundshell unas] [HKEY_CLASSES_ROOTDirectoryBackgroundshell unas] @="Open cmd here as Admin" "HasLUAShield"="" [HKEY_CLASSES_ROOTDirectoryBackgroundshell unascommand] @="cmd.exe /s /k pushd "%V"" [-HKEY_CLASSES_ROOTDriveshell unas] [HKEY_CLASSES_ROOTDriveshell unas] @="Open cmd here as Admin" "HasLUAShield"="" [HKEY_CLASSES_ROOTDriveshell unascommand]
复制上面的代码,保存至txt, 并更改后缀为 .reg ,如cmd.reg
双击运行 ,即将该命令注册到注册表。
然后 在当前文件夹下右键 就可以看到 “Open cmd here as Admin” 。