Reccomend A Feature - Auto Remove Files

I have an enormous Flac music collection, and my hard drive failed a few months ago. I was able to transfer my music to another backup hd but a some of the files have become corrupted. I’m not sure exacly which of my 76,000+ songs is incomplete, but when I load lots of music onto my Fuze, It will occasionally freak out and freeze after trying to play a track. What I would love is a feature, or script, or macro that recognized a file as having crashed the sanza and remove it from the memory stick. Or better yet, If it could do this automatically before freezing. Just a thought.

Sometimes, depending on the level of corruption, running ChkDsk can fix those files. So removing the offending file(s) before one has a chance to salvage them wouldn’t necessarily be a good idea.

@echo off :: Purpose: Test FLACs. Copy good FLACs to new folder. :: Install: Create C:\Test. Place script & flac.exe in C:\Test :: Use: Drag&drop FLAC folder onto script. Good FLACs copied to C:\Test\Good. :: Required: flac.exe from http://flac.sourceforge.net/download.html :: Limitation: If file has non-ANSI chars (eg Unicode), file flagged as bad. setlocal setlocal EnableDelayedExpansion set "Test=C:\Test" set "Good=C:\Test\Good" if not exist %Test%\flac.exe goto .End if '%1'=='' goto .End cd /d "%Test%" md "%Good%" 2\>nul del %Test%\TestedFlacs.list 2\>nul for /r %1 %%a in (\*) do ( set "\_flac=%%a" echo. echo Testing "!\_flac!"... flac -t -s "!\_flac!" 2\>nul if errorlevel 1 call :.BadFlac if not errorlevel 1 call :.GoodFlac ) goto .End :.GoodFlac echo Good FLAC. echo Copying good FLAC to %Good%... xcopy /y "%\_flac%" "%Good%" \>nul goto :eof :.BadFlac echo Bad FLAC. goto :eof :.End echo. pause

Script above is for Windows 2000 or newer. Copy & paste into Notepad and save as Test.cmd. Read script header for use.

@echo off :: Purpose: Test FLACs. Copy good FLACs to new folder. :: Install: Create C:\Test. Place script & flac.exe in C:\Test :: Use: Drag&drop FLAC folder onto script. Good FLACs copied to C:\Test\Good. :: Required: flac.exe from http://flac.sourceforge.net/download.html :: Limitation: If file has non-ANSI chars (eg Unicode), file flagged as bad. setlocal setlocal EnableDelayedExpansion set "Test=C:\Test" set "Good=C:\Test\Good" if not exist %Test%\flac.exe goto .End if '%1'=='' goto .End cd /d "%Test%" md "%Good%" 2\>nul for /r %1 %%a in (\*) do ( set "\_flac=%%a" echo. echo Testing "!\_flac!"... flac -t -s "!\_flac!" 2\>nul if errorlevel 1 call :.BadFlac if not errorlevel 1 call :.GoodFlac ) goto .End :.GoodFlac echo Good FLAC. echo Copying good FLAC to %Good%... xcopy /y "%\_flac%" "%Good%" \>nul goto :eof :.BadFlac echo Bad FLAC. goto :eof :.End echo. pause

 Script above works in Windows 2000 or newer. Copy & paste into Notepad, and save as Test.cmd. Read script header for use.

Message Edited by TomJensen on 05-03-2010 05:59 PM

TomJensen wrote:

Script above works in Windows 2000 or later. Copy & paste into Notepad and save as Test.cmd. Read script header for use.

Looks fine, except didn’t the OP want this to happen on his player, not on his computer?

@OP

The script doesn’t work when a pathname has an ampersand [&]. The errorlevel returned is always 0 which equates to ‘GOOD’. I’ll revise the script to workaround the errorlevel problem later.

@Tapeworm

The script tests all 76K files. They have to be tested on the PC.

Once the bad files are culled, getting good FLACs onto Fuze is assumed.

Files need to be tested on PC. Once bad files are culled, copying good files onto Fuze is assumed.

Yea, but since that will probably never happen…

Actually, the script will work for files on the Fuze. Just drag-drop the Music folder onto it.

BTW, it will work with subfolders within the dropped folder. So if the OP has all his 76K FLACs in one master folder, one drag-drop should test the whole bundle.