zoukankan      html  css  js  c++  java
  • windows添加“以管理员身份运行”

    方法:

    1. 新建一个txt文件,命名为"admin.txt",记得打开“显示后缀名”,要求看到.txt并可修改之。

    2. 将下列代码粘贴进去。

      Windows Registry Editor Version 5.00
      [HKEY_CLASSES_ROOT*shell
      unas]@="管理员取得所有权""NoWorkingDirectory"=""
      [HKEY_CLASSES_ROOT*shell
      unascommand]@="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_ROOTexefileshell
      unas2]@="管理员取得所有权""NoWorkingDirectory"=""
      [HKEY_CLASSES_ROOTexefileshell
      unas2command]@="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_ROOTDirectoryshell
      unas]@="管理员取得所有权""NoWorkingDirectory"=""
      [HKEY_CLASSES_ROOTDirectoryshell
      unascommand]@="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"
      
      
    3. 保存为"admin.reg",准备写入注册表。

    4. 双击之,将其写入注册表即可。

    效果:再次右键点击某文件的时候,就会发现菜单栏里多了一项“管理员取得所有权”,我们的目的也就达到了。

    后记:以前每次装机后,都会百度这对代码,现在还是记录一下吧,不然也麻烦。

  • 相关阅读:
    机器学习面试
    网易有道2017内推编程题2道
    老曹眼中的网络编程基础
    MySQL索引背后的数据结构及算法原理
    [oracle] oracle-ibatis-整理
    [oracle] oracle-myibatis-整理
    [mysql] mysql-myibatis-整理
    [JS] selector 背景选择器
    [android] AndroidManifest.xml 详解
    [Eclipse] 项目编码
  • 原文地址:https://www.cnblogs.com/young233/p/11946755.html
Copyright © 2011-2022 走看看