Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rename all files in a directory with .jpg extension 1

Status
Not open for further replies.

mtg0711

Technical User
Oct 6, 2009
5
US
I am writing a program to make it easy to gather pictures of sites such as Facebook by using my browser cache. This program will take all cache files (no extension) and add .jpg to all the files in the directory the user browses for.

I already have the part where the user chooses the directory figured out, but I am having problems with the code I would use for the next step. It will need to read all the files in the chosen directory and just add .jpg to the end (e.g. CACHE_001 -> CACHE_001.jpg)

I am using Microsoft Visual Basic Express Edition (info can be for version 2005 or 2008)
 
Take a look at the FileSystemObject and the Name As

Never knock on Death's door: ring the bell and run away! Death really hates that!
 
OK, I am still confused on what the code for this would look like. I'm just getting started with VB still
 
Visual Basic Express questions would be better addressed in forum796
 
Why not stick with the good old DOS command?
==> ren [pathtoyourfolder]\*.* *.jpg

And Bob's yer uncle!
:)

[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 
Gotta love it. For the trip down memory lane - and a unspoken comment on KISS - have a star.

"A little piece of heaven
without that awkward dying part."

advertisment for Reese's Peanut Butter Cups (a chocolate/peanut butter confection)

Gerry
 
Thanks Gerry!

The simplest way usually is the most efficient one.
:)

[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top