删除文件夹时提示“You need permission to perform this action。。。”,如何解决?

Win10系统,有时,要删除某个文件夹,却提示“You need permission to perform this action。。。”

以下是我Google之后找到的解决方案

1.创建一个文本文件,文件名随意,我把它命名为Script.txt

2.把以下脚本复制到Script.txt中(其中的Folder To Delete,替换成要删除的文件夹的名字)

SET DIRECTORY_NAME="Folder To Delete"
TAKEOWN /f %DIRECTORY_NAME% /r /d y
ICACLS %DIRECTORY_NAME% /grant administrators:F /t
PAUSE

3.把Script.txt重命名为Script.bat

4.以管理员身份运行此bat文件,执行完毕后,我们就可以像往常那样把文件夹删掉了^_^

参考自:How to delete a folder which ask “You need permission to perform this action. You require permission from…” even you are administrator of that folder. – Welcome to my blog

原文地址:https://www.cnblogs.com/buyishi/p/11229022.html