![]() |
Generating files MSDOS Batch
I would like to create a batch script that I will put on a scheduled task "XP" (Mon-Fri) to create a simple text file:
the text file's name is today's date the content of the File is a dynamic url derived from the today's date example the filname is mmddyy.strm the content is mms://hostname/mmddyy/ thanks for the help |
Well.. look into the %date% variable. This doesn't give a mmddyy format, but you might be able to modify it. You could use the echo command and output operators (> for truncating or >> for appending) for the file. Example:
:
echo mms://hostname/%date%/ >> %date%.strmOf course, this would pose the problem of illegal characters in a filename ('/'), so you'd have to find a way to modify the data given from the %date% variable. Good luck. |
Oh, I've just noticed the DATE command will give you the DD/MM/YYYY (maybe MM/DD/YYYY on machines in the US; this one's set up for the UK) format date. It prompts for a new date, but you can do:
:
C:\> echo. | dateto avoid that. |
| All times are GMT -5. The time now is 6:13 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC