Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Batch to delete Thumbs.db


  • Please log in to reply
12 replies to this topic

#1 Vaine

Vaine

  • Members
  • 133 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Somewhere in NewYork
  • Local time:12:33 PM

Posted 06 February 2009 - 10:21 PM

I want a batch file to find and delete the multiple THUMBS.DB on the Local Disk (C:)

This is all I have which is a CMD Command.

del /s /q Thumbs.db


Is there a way to convert that into a batch command?

BC AdBot (Login to Remove)

 


#2 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:09:33 AM

Posted 06 February 2009 - 10:52 PM

Er... that is a batch command :thumbsup: Just fully qualify the path:

del /s /q C:\Thumbs.db

Billy3
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image

#3 Vaine

Vaine
  • Topic Starter

  • Members
  • 133 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Somewhere in NewYork
  • Local time:12:33 PM

Posted 06 February 2009 - 11:00 PM

How do I add the drive letter to this?

#4 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:09:33 AM

Posted 06 February 2009 - 11:31 PM

Er... that is a batch command :thumbsup: Just fully qualify the path:

del /s /q C:\Thumbs.db

Billy3


Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image

#5 Vaine

Vaine
  • Topic Starter

  • Members
  • 133 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Somewhere in NewYork
  • Local time:12:33 PM

Posted 09 February 2009 - 06:58 AM

The batch file tells me that there is an error with the code. Sorry. I did not see that C: part haha.

#6 Andrew

Andrew

    Bleepin' Night Watchman


  • Moderator
  • 8,260 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:Right behind you
  • Local time:09:33 AM

Posted 09 February 2009 - 01:47 PM

Your original command ought to be fine without qualifying the path. Just type it into a txt file and name it something like "killthumbs.bat".

#7 Vaine

Vaine
  • Topic Starter

  • Members
  • 133 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Somewhere in NewYork
  • Local time:12:33 PM

Posted 10 February 2009 - 07:19 AM

Do I have to make the CD\ code in there? My DOS Window is showing Documents and settings?

CD\
del /s /q C:\Thumbs.db

#8 mysticduck

mysticduck

  • Members
  • 35 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Southern Oregon
  • Local time:09:33 AM

Posted 13 February 2009 - 12:49 PM

Are there specific Thumbs.db files you are trying to get rid of, or just all the Thumbs.db files on the C: drive?
Stultorum infinitus est numerus

#9 emucade

emucade

  • Members
  • 34 posts
  • OFFLINE
  •  
  • Location:Santa Fe N.M.
  • Local time:12:33 PM

Posted 14 February 2009 - 06:29 PM

not sure wear the thumbs.db are located but lets just say thay are in a directory called inernet\thumbs

Maybe this

run then cmd

copy con: delthumbs.bat
@echo off
cls
del c:\inernet\thumbs\thumbs*.db*
Pause
exit

"then press CTRL Z to save batch"
this might work. If you could tell me what directory the thumb files are in I could test this.

Edited by emucade, 14 February 2009 - 06:37 PM.

" If you want to be the best you better learn how do defend yourself,
Because when you are the best everybody wants to kick you’re a** "
My Dad 1986

#10 Vaine

Vaine
  • Topic Starter

  • Members
  • 133 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Somewhere in NewYork
  • Local time:12:33 PM

Posted 15 February 2009 - 11:44 AM

Thumbs.db is allover the C: drive. Usually in folders where pictures are

#11 OldNick

OldNick

  • Members
  • 9 posts
  • OFFLINE
  •  
  • Local time:11:33 AM

Posted 15 March 2009 - 07:23 PM

Sorry to butt in, but I have a similar problem

Code:
del AusPhotoForums\*.*

rem AND EVEN TRIED
del AusPhotoForums\thumbs.db

del \ausphotoforums\controls\*.*

pause
rmdir \AusPhotoForums
rmdir \ausphotoforums\controls
pause
rem Message "Folder is not empty"

It seems that DOS is not able to delete the Thumbs.db file. In Windows I am always prompted for deletion of Thumbs.db if I try to delete all files. In DOS I am simply being refused.

Can anyone help me from this aspect of it?

Thanks

Nick

#12 OldNick

OldNick

  • Members
  • 9 posts
  • OFFLINE
  •  
  • Local time:11:33 AM

Posted 16 March 2009 - 02:01 AM

It's OK I sorted it :thumbsup:

Nick

#13 OldNick

OldNick

  • Members
  • 9 posts
  • OFFLINE
  •  
  • Local time:11:33 AM

Posted 16 March 2009 - 02:41 AM

You want to delete ALL thumbs.db files on your computer, right?

There used to be deltree. A powerful but dangerous command.

However:
In a text file called KillThumbs.bat"

attrib /s -r -h -s "c:\thumbs.db"

del /s /q "c:\thumbs.db"

****USE AT YOUR OWN RISK. ****

copy a folder that has lots of subfolders with thumbs.db in them to another location and run it over that first
- ****CHANGING THE FOLDER CALLS ABOVE TO SUIT.****
Leave Echo on at least for the test, so you can see if it's doing what you want to this test folder and its subfolders.


It works in theory. It will take a while to run, because it will search every directory of your C drive twice.

****DO NOT GET ANYTHING WRONG! THIS IN THEORY COULD WIPE YOUR DRIVE.****

I have tied it on a test folder that I copied. It is my \nickdocs\photos folder, and I copied it to the c:\ root directory. IT worked on that folder and all its subfolders.

Good Luck

Nick




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users