How to delete folders that don't have Administrator Permission to delete?

Опубликовано: 21 Сентябрь 2023
на канале: Digital Experts
99
1

How to delete folders that don't have Administrator Permission to delete?

Copy and paste this script into your plain notepad and save it at delete.bat.

SET DIRECTORY_NAME="D:\WindowsApps"
TAKEOWN /f %DIRECTORY_NAME% /r /d y
ICACLS %DIRECTORY_NAME% /grant administrators:F /t
ICACLS %DIRECTORY_NAME% /reset /T
PAUSE

Don't forget to change your own folder directory name. For example:
D:\WindowsApps to your own D:\ Myfolders