Skip to content

Instantly share code, notes, and snippets.

@sertalpbilal
Created June 21, 2016 18:32
Show Gist options
  • Save sertalpbilal/ef970688117fb4ca1ec3f5ea342d4e40 to your computer and use it in GitHub Desktop.
Save sertalpbilal/ef970688117fb4ca1ec3f5ea342d4e40 to your computer and use it in GitHub Desktop.
A small windows command line script for removing empty .mp3 files
@ECHO OFF
for /r %%F in (*) do if %%~zF LSS 1000000 ( if %%~xF EQU .mp3 del "%%F" )
@sertalpbilal
Copy link
Author

sertalpbilal commented Jun 21, 2016

This script looks all subfolders and remove those files with specified extension (.mp3 in this case) and under a certain file size (1000000 B ~= 1 MB in this case). Use (%%~zF ==0) to remove only ones that are 0 bytes. I used this script to clear my mp3 player where some files were corrupted while copying. Also, use "echo %%F" instead of "del %%F" if you want to see a list of files before deleting them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment