DOS: create filename based on date?

Closed
whitedog1 - Jul 24, 2009 at 08:33 AM
ebley Posts 1 Registration date Saturday January 19, 2013 Status Member Last seen January 19, 2013 - Jan 19, 2013 at 02:32 AM
Hello,

I need to be able to automatically generate a DOS .txt filename that is the 'date' of when it is created.

Any ideas? My DOS is rather rusty and have run out of ideas.
Related:

7 responses

You might try something like this...


set filea=MyBigFile%date:~10%%date:~4,2%%date:~7,2%%time:~0,2%%time:~3,2%.sav
copy MyData.dat %filea%

Since the date is Thu 07/30/2009 and the time is 14:07:00.00,
For today this would give a file named
MyBigFile200907301407.sav

good luck
25