快速在指定目录打开命令行

2024-10-13 13:52:06

1、我们在想要到达的目录上按住shift键并点击鼠标右键。看到了吗,这时候在弹出菜单里多了一个选项,就是“在此处打开命令窗口”,我们点开看一下。

快速在指定目录打开命令行

3、不过有时候我们需要以管理员的黑具跑秀权限来打开命令行,这时候我们需要自行添加一个脚本,方便操作,你可以复制下面的代码然后保存为.reg格式。[HKEY_CLASSES_ROOT概嗤先眚\Directory\shell\runas]@="Open cmd here as Admin""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]@="Open cmd here as Admin""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]@="Open cmd here as Admin""HasLUAShield"=""[HKEY_CLASSES_ROOT\Drive\shell\runas\command]@="cmd.exe /s /k pushd \"%V\""

4、运行保存好的reg文件,进行注册表导入。

快速在指定目录打开命令行

6、权限提示,我们点击“是”按钮,允许以管理员身份执行。

快速在指定目录打开命令行

7、需要删掉这个右键选项是,请复制下面的代码并执行。(参照3、4步骤)Windows Registry Editor Version 5.00 ; Created by: Shawn Brink; http://www.sevenforums.com; Tutorial: http://www.sevenforums.com/tutorials/47415-open-command-window-here-administrator.html [-HKEY_CLASSES_ROOT\Directory\shell\runas] [-HKEY_CLASSES_ROOT\Directory\Background\shell\runas] [-HKEY_CLASSES_ROOT\Drive\shell\runas]

猜你喜欢