Discussion Locked

Create a file with the date as the name?

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a windows software from which I could create a log file. Is it possible to specify a file name with some dos command to get something like : log`date`.txt and the resulting filename will be : log20020619.txt

Thanks for your help

3 replies

by joseph moore

Sure. You can put this in a BAT file and run it daily. Here is the syntax:

for /f "tokens=1-4 delims=/ " %%i in ('date /t') do copy YOURFILE.TXT LOG%%l-%%j-%%k

Hope this helps

This discussion is closed to new replies.