windows添加右键打开cmd和Powershell窗口(管理员/非管理员)

admin 2021年1月21日04:31:50评论120 views字数 1337阅读4分27秒阅读模式
摘要

cmdPowershell 用惯了linux的右键打开在此处cmd,就想把windows也改一下。(测试环境win10)

cmdPowershell

前言

用惯了linux的右键打开在此处cmd,就想把windows也改一下。(测试环境win10)

使用

鼠标右键:
在此处打开命令行窗口
在此处打开命令行窗口(管理员)
shift + 鼠标右键:

在此处打开 Powershell 窗口
在此处打开 Powershell 窗口(管理员)

代码

新建xx.reg,输入以下代码

Windows Registry Editor Version 5.00   ; 若原先有,先删除原来的 [-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" 

来源:http://www.safe6.cn/

本文由 safe6 创作,著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。

windows添加右键打开cmd和Powershell窗口(管理员/非管理员)

本站的所有程序和文章,仅限用于学习和研究目的;不得用于商业或者非法用途,否则,一切后果请用户自负!! 最后编辑时间为: 2020-03-01

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2021年1月21日04:31:50
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   windows添加右键打开cmd和Powershell窗口(管理员/非管理员)http://cn-sec.com/archives/247620.html

发表评论

匿名网友 填写信息