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

Updating a file name to the current date!!!!

Status
Not open for further replies.

Kckronic21

Programmer
Joined
Jul 29, 2001
Messages
81
Location
US
Hi, Could someone please tell me how to constantly update a file name (Employee.mdb) to the current date (02-04-02_Employee.mdb). Thanks!
 
edit the file or open it and that saves it to the current date
 
For a batch file, under win9x...

I got this from the site listed in the comments.

I wrote my own variations for different purposes.

start file---------------------
:: D&T.BAT - Saves Date and/or Time into a named environment variable.
:: Tom Lavedas <lavedas@pressroom.com>
:: @echo %dbgt% off
%3 echo %0 %%3 %%4 :: %1 %2> {a}.bat
%3 dir {a}.bat | find &quot;{A} &quot; > {t}.bat
%3 {t}
del {?}.bat
if [%4]==[] echo Date: %1 Time: %2
if not [%4]==[] set %4=%1
if not [%5]==[] set %5=%2
end file------------------------------

I called that one &quot;getdate.bat&quot; and called it with the following:

start file----------------------------
getdate datename
rename fubar.mdb %datename%_fubar.mdb
end file------------------------------

good luck.
 
The visitor, racer766, is on the money. You'll need to create a program which will do it for you.

Can you write yourself a program?

In either case, what OS do you have? --MiggyD

It's better to have two heads to solve a problem from different angles than to have tunnel vision to a dead end.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top