zoukankan      html  css  js  c++  java
  • 通过注册表强制解锁文件占用

    将下面的文本保存为 xxx.reg 并运行一下,添加注册表项目。

    Windows Registry Editor Version 5.00
    [HKEY_CLASSES_ROOT*shell	akeownership]
    @="Take ownership"
    "HasLUAShield"=""
    "NoWorkingDirectory"=""
    [HKEY_CLASSES_ROOT*shell	akeownershipcommand]
    @="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	akeownership]
    @="Take ownership"
    "HasLUAShield"=""
    "NoWorkingDirectory"=""
    [HKEY_CLASSES_ROOTexefileshell	akeownershipcommand]
    @="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_ROOTdllfileshell	akeownership]
    @="Take ownership"
    "HasLUAShield"=""
    "NoWorkingDirectory"=""
    [HKEY_CLASSES_ROOTdllfileshell	akeownershipcommand]
    @="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	akeownership]
    @="Take ownership"
    "HasLUAShield"=""
    "NoWorkingDirectory"=""
    [HKEY_CLASSES_ROOTDirectoryshell	akeownershipcommand]
    @="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"
    

    需要删除时只需要右键选择Take Overship

    当你要删除一个文件而遇到“无法删除需要权限”的提示时,只要对着文件按下右键,选择『Take ownership』再删除文件即可。

  • 相关阅读:
    Spring缓存注解@Cache使用
    Java中BigDecimal的8种舍入模式
    mysql和oracle的mybatis操作
    MyEclipse开发JAX-RS架构WebServices收发JSON数据格式
    Hibernate 常见异常
    SQL笔试题
    Map按键排序(sort by key)
    Spring+Mybatis常见问题随笔
    md5utils
    Http请求中Content-Type讲解以及在Spring MVC中的应用
  • 原文地址:https://www.cnblogs.com/csnd/p/11776698.html
Copyright © 2011-2022 走看看