Created
June 21, 2016 18:32
-
-
Save sertalpbilal/ef970688117fb4ca1ec3f5ea342d4e40 to your computer and use it in GitHub Desktop.
A small windows command line script for removing empty .mp3 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
for /r %%F in (*) do if %%~zF LSS 1000000 ( if %%~xF EQU .mp3 del "%%F" ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.