Delete Big Folder On Windows By .bat
1. Content of .bat file:
@echo off
echo --------------------WARNING--------------------
echo folder "%~1" will be deleted
echo --------------------WARNING--------------------
pause
echo Deleting folder: "%~1".
time /T
del /f/s/q "%~1" >nul
rmdir /s/q "%~1" >nul
echo Done.
time /T
echo --- Taking ownership.
takeown /f "%~1" /r /d y >nul
icacls "%~1" /reset /t >nul
icacls "%~1" /setowner "%username%" /t >nul
echo Done all.
time /T
2. Use it:
1. Make a new .bat file, for example: delfolder.bat
.
2. Put it on the C:\Windows
and then you can use the command: delfolder <folderName>
.