• 鼠标右键打开命令行cmd(管理员身份)


    参考:https://blog.csdn.net/bdss58/article/details/54745380

    添加到注册表

    将下面命令保存为reg文件:

    Windows Registry Editor Version 5.00
    
    [-HKEY_CLASSES_ROOTDirectoryshell
    unas]
    
    [HKEY_CLASSES_ROOTDirectoryshell
    unas]
    @="Open command window here as Administrator"
    "HasLUAShield"=""
    
    [HKEY_CLASSES_ROOTDirectoryshell
    unascommand]
    @="cmd.exe /s /k pushd "%V""
    
    [-HKEY_CLASSES_ROOTDirectoryBackgroundshell
    unas]
    
    [HKEY_CLASSES_ROOTDirectoryBackgroundshell
    unas]
    @="Open command window here as Administrator"
    "HasLUAShield"=""
    
    [HKEY_CLASSES_ROOTDirectoryBackgroundshell
    unascommand]
    @="cmd.exe /s /k pushd "%V""
    
    
    
    [-HKEY_CLASSES_ROOTDriveshell
    unas]
    
    [HKEY_CLASSES_ROOTDriveshell
    unas]
    @="Open command window here as Administrator"
    "HasLUAShield"=""
    
    [HKEY_CLASSES_ROOTDriveshell
    unascommand]
    @="cmd.exe /s /k pushd "%V""
    
    
    
    [-HKEY_CLASSES_ROOTLibraryFolderackgroundshell
    unas]
    
    [HKEY_CLASSES_ROOTLibraryFolderackgroundshell
    unas]
    "HasLUAShield"=""
    @="Open command window here as Administrator"
    
    [HKEY_CLASSES_ROOTLibraryFolderackgroundshell
    unascommand]

    保存 文件名为 Add_Open_Command_Window_Here_as_Administrator.reg 
    然后双击执行就可以了。

    卸载

    类似上面的,执行下面注册表命令就可以了:

    Windows Registry Editor Version 5.00
    
    [-HKEY_CLASSES_ROOTDirectoryshell
    unas]
    
    [-HKEY_CLASSES_ROOTDirectoryBackgroundshell
    unas]
    
    [-HKEY_CLASSES_ROOTDriveshell
    unas]
    
    [-HKEY_CLASSES_ROOTLibraryFolderackgroundshell
    unas]
    ~ 

    补充:

    1、HasLUAShield   By creating a registry value named HasLUAShield (REG_SZ) on the static verb, you can add the UAC shield icon to the corresponding item in the right-click menu. 参考:https://www.winhelponline.com/blog/add-uac-shield-icon-right-click-context-menu-windows-7/

    2、pushd   The Pushd command stores the current directory for use by the popd command, and then changes to the specified directory.  参考:http://www.windowscommandline.com/pushd/ 和  https://baike.baidu.com/item/pushd/8514754?fr=aladdin

  • 相关阅读:
    错排问题
    用GDAL/OGR去读shapefile
    聊聊MyBatis缓存机制
    一份平民化的应用性能优化检查列表(完整篇)--转
    微服务实战(七):从单体式架构迁移到微服务架构
    微服务实战(六):选择微服务部署策略
    微服务实战(五):微服务的事件驱动数据管理
    微服务实战(四):服务发现的可行方案以及实践案例
    微服务实战(三):深入微服务架构的进程间通信
    微服务实战(一):微服务架构的优势与不足
  • 原文地址:https://www.cnblogs.com/pu369/p/9988327.html
Copyright © 2020-2023  润新知