How do I delete album art, desktop.ini, and thumbs.db from my music folder in Windows 7? I can see all of these files because I took the hard drive from my old computer and put it in my new one. It now has all of these junk files that the OS does not use, so I want to delete them and get them out of my sight.
4 Answers
This did the trick for me, using Windows 7's Power Shell. Saving this answer, in case anyone else has this problem.
Get-ChildItem -incl "desktop.ini","thumbs.db","*.jpg" -path "V:\Music" -force -recurse | Remove-Item
This should work in Linux, but I've not tested it so I'm not really sure.
find ~/music -type f -name "desktop.ini" -delete
find ~/music -type f -name "Thumbs.db" -delete
find ~/music -type f -name "*.jpg" -delete
- 235,242
- 1,359
You can prevent creation of thumbs.db in Windows Vista and above (7 etc) by opening the Local Group Policy Editor (
+R and enter gpedit.msc) and go to;
User Configuration -> Administrative Templates -> Windows Components > Windows Explorer
or File Explorer for win 8
And edit Turn off the caching of thumbnails in hidden thumbs.db files. Enable it and hit OK.
To delete ones already created you can right click -> Properties on the drive from My Computer, hit Disk Cleanup, tick only Thumbnails and hit OK.
If you cant access the LGPE (e.g. MMC could not create the snap-in) or it just plain didn't work you can dabble in the registry;
HKEY_CURRENT_USER -> Software -> Microsoft -> Windows -> CurrentVersion -> Explorer -> Advanced
set DisableThumbnailCache to 1
If DisableThumbnailCache doesn't exist, create it as a new DWORD
reboot may or may not be required
- 3,338
- 4
- 39
- 51
To expand in Bigbio2002's answer you can add the cd inside the batch file.
Here's the modified version. I just saved this to the root directory of my NAS folder which is mapped to Z and this will work for any other drive that has a drive letter.
You could go one extra step and add this to a task in Task Scheduler in Windows to run once you log in, which is what I have done.
@echo off & title %~nx0 & color 5F & chcp 65001 >NUL
cd /d "%cd%"
echo Cleaning 'thumbs.db' files from %cd% and all of its sub-directories.
echo/
del /s /q /f /a:h ".\*thumbs.db"
- 1,352
This can be done with two one-liners from a command prompt...
First, open up a cmd window, then cd to your Music folder. Then, run the following 2 commands:
del /s /q /f /a:h ".\*thumbs.db"
del /s /q /f /a:s ".\*desktop.ini"
These will recursively delete all of the desired files in your current directory.
- 3,944