None of that is working :s
Well I got 2 types of files:
- The @eaDir that could be deleted by simply searching them in explorer and deleting them all.
- The @eaDir folders that could not be deleted: they "Cannot find this item" when I try to delete them.
When I try to disable the read-only on them
I get "there has been an error." "Cannot find given file: "content of @eaDir"."
After spending quite some time looking for a solution, I got this command to run in cmd:
@Echo OFF
REM Important that Delayed Expansion is Enabled
setlocal enabledelayedexpansion
REM This sets what folder the batch is looking for and the root in which it starts the search:
set /p foldername=Please enter the foldername you want to delete:
set /p root=Please enter the root directory (ex: C:\TestFolder)
REM Checks each directory in the given root
FOR /R %root% %%A IN (.) DO (
if '%%A'=='' goto end
REM Correctly parses info for executing the loop and RM functions
set dir="%%A"
set dir=!dir:.=!
set directory=%%A
set directory=!directory::=!
set directory=!directory:\=;!
REM Checks each directory
for /f "tokens=* delims=;" %%P in ("!directory!") do call :loop %%P
)
REM After each directory is checked the batch will allow you to see folders deleted.
:end
pause
endlocal
exit
REM This loop checks each folder inside the directory for the specified folder name. This allows you to check multiple nested directories.
:loop
if '%1'=='' goto endloop
if '%1'=='%foldername%' (
rd /S /Q !dir!
echo !dir! was deleted.
)
SHIFT
goto :loop
:endloop
It is very good at deleting the normal folders (which I can also do via explorer searching)
But it cannot delete those other @eaDir folders...
I tried adding /f after the /s and /q part, not helping either.