Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save digitalfun/62e39818d5d76dcacfcf to your computer and use it in GitHub Desktop.

Select an option

Save digitalfun/62e39818d5d76dcacfcf to your computer and use it in GitHub Desktop.
Lists/Deletes all duplicates in the active directory using command line tool "SwissFileKnife" from Stahlworks.
@ECHO OFF
REM Lists/Deletes all duplicates in the active directory.
REM Uses: sfk.exe | SwissFileKnife | http://stahlworks.com/dev/swiss-file-knife.html
REM Configuration ++++++++++++++++++++
SET FILE_EXT=txt
SET SEARCH_PATH=.
REM ----------------------------------
ECHO.
sfk dupfind %SEARCH_PATH% .%FILE_EXT% +del
ECHO.
ECHO.
echo If you want to do delete the files, type "y" and press enter ...
SET /p option=
IF '%option%'=='y' GOTO :delete
EXIT
:delete
sfk dupfind %SEARCH_PATH% .%FILE_EXT% +del -yes
PAUSE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment