Rename a file without knowing file name

eshai

Registered User.
Local time
Today, 14:30
Joined
Jul 14, 2015
Messages
195
hi
i have a db that take a snapshot to "c:\img" with extension of "jpg"
there is only one file in the folder at a time
the file saved each time with a different name
how do i rename the file to "1.jpg"
 
Hi,

You can use the Dir() function to get the name of the file, so you can rename it.
 
This simple test worked for me:

Name "C:\yourfolderpath\" & Dir("C:\yourfolderpath\") AS "C:\yourfolderpath\test.jpg"

If you want to use part of the original name in the new name, will have to parse the file name returned by the Dir() function.
 
Hi,

You can use the Dir() function to get the name of the file, so you can rename it.

tnx
i know but my head is to busy that i can't go over the dir function :banghead:
need help writing the code
 
This simple test worked for me:

Name "C:\yourfolderpath" & Dir("C:\yourfolderpath") AS "C:\yourfolderpath\test.jpg"

If you want to use part of the original name in the new name, will have to parse the file name returned by the Dir() function.

thank you that work perfect
love you
 
Hi June7. Thanks for the assist.
 

Users who are viewing this thread

Back
Top Bottom