Hello everyone:

I have the following issue, i have and old computer and i need to erase pics and all that, but that computer has several folders and some are hidden, and is very time consuming checking where are those folders.

I would like a VBS to erase all the pics from that computer and to show and erase the hidden ones.

Hope someone can help with this.

Note: there is no need to format the computer, just to erase all the pices and the format of those picks are .jpeg and .jpg

Thanks in advance

Recommended Answers

All 5 Replies

You need to write a recursive function to find and delete all the files of specific format.

Kindly post the code that you are working on currently.

You need to write a recursive function to find and delete all the files of specific format.

Kindly post the code that you are working on currently.

I`m new to this VBs so i have not worked on any code yet, i was hopping someone could give me en example or a guide on how to start with

You actually don't need vbscript to do this. Go to a DOS prompt and type

dir /?

That will show you how to get a list of all the things you need. Try this:

dir *.jp* /s /b > myfiles.txt

This will give you a list of all files (with directory information!) that have .jp* extension (e.g. .jpg, jpeg) and store it in a text file. You can then use a good text editor to add a del statement to each line, or to remove lines if you don't want to delete the files in question. Kind of old-school, I know, but if it's a one-time task, why spend the time to learn a new language?

You actually don't need vbscript to do this. Go to a DOS prompt and type

dir /?

That will show you how to get a list of all the things you need. Try this:

dir *.jp* /s /b > myfiles.txt

This will give you a list of all files (with directory information!) that have .jp* extension (e.g. .jpg, jpeg) and store it in a text file. You can then use a good text editor to add a del statement to each line, or to remove lines if you don't want to delete the files in question. Kind of old-school, I know, but if it's a one-time task, why spend the time to learn a new language?

I agree. But this won't work with hidden folders. But then again, if they are hidden folders, you wouldn't have pictures in them, would you?

Alternatively, look at ZTREE. It will allow you do do exactly what you need with little fuss.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.