1.

Solve : Need batch file to use current date.?

Answer»

Hi

I am under pressure to create a backup of an Access database. I reckon the easiest WAY is to just copy the database to a different directory with the current date included in the file name
e.g. if the source file is called tester.mde, then I want to copy it to a different directory with the name 20051109tester.mde.
I reckon it should be easy to do this in a DOS batch file but I can't seem to FIGURE it out !
Any help appreciated.

Thanks

KevinYou didn't mention an OS, so I can only guess if this will WORK for you.

Code: [Select]
@echo off
for /f "tokens=2-4 delims=/ " %%a in ('date /t') do (
copy path\tester.mde path\%%c%%a%%btester.mde
)


Just change path to something valid on your machine.

Hope this helps. That worked PERFECTLY - thank you very very much.
You got me out of a BIND !

Kevin



Discussion

No Comment Found