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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apply a file extension change to an entire folders contents?

Status
Not open for further replies.

deintinis

IS-IT--Management
Nov 14, 2001
174
0
0
US
I have about 300 photos that I need to insert into Access. All the photos are .jpeg's, but Access requires a .bmp. Is there a way to change the file extensions for all of these files at once?
 
There is a quick way but it is not Access code based. You can do a bulk extension change through DOS. The following would be the senario:

1)Go to DOS prompt. Click on start run and type cmd (for NT) or command for Win 95/98

2)Type in the following command:
ren c:\mydir\*.jpeg *.bmp

This means rename all files with a jpeg extension to a bmp extension.
 
Here is how you can execute internal DOS commands from Access.

Place the function below in a module -

Function FileRename()
Dim hTask As Integer

hTask = Shell(Environ("COMSPEC") & " /C rename C:\TEMP\*.jpg *.bmp", 1)

End Function

The only thing that you will need to modify will be the path where the files you wish to rename exist.

 
Thanks for the help. I ended up finding a program called name wiz that allowed me to manipulate multiple files at once. I appreciate the additional insight.
 
I assume you might need to convert the files rather than just rename them?

When I had a similar requirement, I found an excellent Freeware program called IrfanView. This has many useful features for manipulating image files, including a batch converter which will convert all files in a folder from e.g. .jpg to .bmp formats.

IrfanView is widely available as a download from freeware library websites.

I hope this is of some help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top