zoukankan      html  css  js  c++  java
  • Win7下添加和取消右键获取管理员权限的方法

    在Win7下经常要用到管理员权限,为了方便可以添加一个右键菜单,方法如下:
    新建一个“记事本”文件,复制以下内容:

    Windows Registry Editor Version 5.00
    [HKEY_CLASSES_ROOT\*\shell\runas]
    @="获取管理员权限"
    "NoWorkingDirectory"=""
    [HKEY_CLASSES_ROOT\*\shell\runas\command]
    @="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
    "IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
    [HKEY_CLASSES_ROOT\exefile\shell\runas2]
    @="获取管理员权限"
    "NoWorkingDirectory"=""
    [HKEY_CLASSES_ROOT\exefile\shell\runas2\command]
    @="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
    "IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
    [HKEY_CLASSES_ROOT\Directory\shell\runas]
    @="获取管理员权限"
    "NoWorkingDirectory"=""
    [HKEY_CLASSES_ROOT\Directory\shell\runas\command]
    @="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
    "IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"



    复制好后选文件-另存为,保存类型选"所有文件",文件扩展名为reg 然后运行即可。

    Win7下取消右键获取管理员权限方法:

    Windows Registry Editor Version 5.00
    [-HKEY_CLASSES_ROOT\*\shell\runas]
    [-HKEY_CLASSES_ROOT\exefile\shell\runas2]
    [-HKEY_CLASSES_ROOT\Directory\shell\runas]




    同样的保存上面内容为reg格式文件即可。

  • 相关阅读:
    【JVM】内存与垃圾回收
    【缓存】缓存与分布式锁
    【Redis】入门与基础总结
    【Elasticsearch7.x】Elasticsearch 入门
    iOS开发ReactiveCocoa学习笔记(六)
    iOS开发ReactiveCocoa学习笔记(五)
    iOS开发ReactiveCocoa学习笔记(四)
    iOS开发ReactiveCocoa学习笔记(三)
    iOS开发ReactiveCocoa学习笔记(二)
    iOS开发ReactiveCocoa学习笔记(一)
  • 原文地址:https://www.cnblogs.com/lazycoding/p/2300276.html
Copyright © 2011-2022 走看看