Hello guys, use this command batch to remove duplicate files in a folder and its subfolders:
SET "StartFolder=."
FOR /r "%StartFolder%" %%i IN (*) DO call:doit "%%~i"
GOTO:EOF
:doit
SET "fname=%~nx1"
SETLOCAL ENABLEDELAYEDEXPANSION
SET "fsize=!$%fname%!"
IF DEFINED $!fname! (
ENDLOCAL
IF "%fsize%"=="%~z1" DEL "%~1"
) ELSE (
ENDLOCAL
SET "$%~nx1=%~z1"
)
GOTO:EOF
I wanted to ask for help in the ability to modify the command, moving the deleted files into the bin, and not permanently.
So that it if necessary can be recovered in the bin.
Thankss.