• 通过注册表强制解锁文件占用


    将下面的文本保存为 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』再删除文件即可。

  • 相关阅读:
    zabbix
    amoeba 读写分离
    部署MySQL-主从异步复制
    MySQL 基本操作
    mysql 完整备份和恢复
    正则匹配表达式各个符文表达的意义
    Include和require的区别
    nosql和Mysql的区别
    Git与SVN的区别
    mongodb与mysql区别
  • 原文地址:https://www.cnblogs.com/csnd/p/11776698.html
Copyright © 2020-2023  润新知