5 replies
by jim.schromm
by meikle
by beermonster
Try putting this in a cmd file (this is for an NT system)-
rem - echo the date to a text file
date /t > c:\today.txt
rem strip the date out of the file and set a variable for it
for /F "tokens=2" %%A in (c:\today.txt) do set today=%%A
rem the next two lines are just to echo to the screen what its doing, you can strip these out
echo %today%
pause
rem in my date format, the components are separated with a / , this line strips that
rem out. If your date has a different separator (sometimes it's \) then edit the line accordingly)
set today=%today:/=%
rem the next two lines are just to echo to the screen what its doing, you can strip these out
echo %today%
pause
Now you can use the %today% variable to name the file
IE
echo hello >> %today%.txt
or
ren someotherfile.txt %today%.txt
Hope this goes ok...
by meikle
by meikle
This discussion is closed to new replies.
Trending Windows Forum posts
Sort by Trending