Showing posts with label console. Show all posts
Showing posts with label console. Show all posts

14 October 2009

Thumbs.DB Annihilator


Here is a computer program that I created that I call Thumbs DB Annihilator!

This program will search your hard drives for all those Thumbs.db files that Windows thinks it has to create and it will DELETE every single one of them. WARNING: This WILL DELETE all THUMBS.DB files on ALL YOUR DRIVES. (Turn off the Windows System feature that creates thumbs.db files)

This program is specifically written for Windows systems and I don't think it will compile on anything else. In this instance it does not matter because all I care about is deleting the thumbs.db files that Windows creates. I will get into creating code that will compile on more than one OS a little later.

Here is the link to the zip file from my Google site:

Thumbsdb.zip

This file has the executable in it and also has the Visual C++ workspace to build it if you have that. The following files should be in the zip file:

c_thumbsdb.cpp contains class CThumbsdbCleaner
c_thumbsdb.h contains definition for class CThumbsdbCleaner
thumbsdb.cpp contains int main(int argc, char* argv[])

If you are using MinGW (GNU C) to compile from command line type these lines into the command prompt to compile it:

g++ -c thumbsdb.cpp
g++ -c c_thumbsdb.cpp
g++ *.o -o thumbsdb.exe

You'll probably notice that it is kind of overly complex code for what it is, but there is a reason for it and I will build on it in the future. I also left in alot of commented out code that you can toy around with to make it delete other files. Be extremely careful with this or you may delete some things you don't want it to. For now, take some time and just look around into the C++ class and structure.

Even with the extra class file and header file, it is a very simple program. It just reads the disks folders and looks through them for the thumbs.db files and if it finds one it zaps it. It adds the total number of files it deletes and the size of the files in case you are curious.

The best way to use this program is from a command prompt, but you can just double click on it from windows and it will still work. The only downfall to executing it by double click is that you won't be able to see the final results because it will close the console window immediately after the program exits.

I will be posting more of my little projects as time passes.

I will talk about Code::Blocks and MinGW coming up...