Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 28th, 2005, 3:13 PM   #1
wmennai
Newbie
 
Join Date: May 2005
Posts: 1
Rep Power: 0 wmennai is on a distinguished road
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
wmennai is offline   Reply With Quote
Old Jun 5th, 2005, 1:34 AM   #2
Riddle
Programmer
 
Riddle's Avatar
 
Join Date: May 2005
Location: Nar Shaddaa
Posts: 42
Rep Power: 0 Riddle is on a distinguished road
Send a message via ICQ to Riddle Send a message via AIM to Riddle Send a message via MSN to Riddle
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%.strm

Of 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.
Riddle is offline   Reply With Quote
Old Jul 21st, 2005, 9:31 AM   #3
mackenga
Professional Programmer
 
Join Date: Mar 2005
Location: Glasgow, Scotland
Posts: 317
Rep Power: 4 mackenga is on a distinguished road
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. | date

to avoid that.
mackenga is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:31 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC