Computer Hope

Microsoft => Microsoft DOS => Topic started by: isko98 on April 25, 2004, 08:34:46 PM

Title: Date Stamp
Post by: isko98 on April 25, 2004, 08:34:46 PM
hi all,

this is a silly question but i hope you all can help me...  

i want ot create a log file that has a date stamp... say after running a bat file, it will generate a log file bat_042604.log (for bat file run on Apr 26 '04) and bat_042704.log for run on Apr 27 '04.  

what command can i use to put the date on a variable in a format 042604 an not 04/26/04  

can any one help
Title: Re: Date Stamp
Post by: isko98 on April 25, 2004, 09:24:06 PM
btw i am using Windows NT ver 4...
Title: Re: Date Stamp
Post by: rosken on May 12, 2004, 04:42:07 AM
Hi
I use this to make a folder named as date.
Ihave tested it with rename it seemed ok
I believe you can use it for time aswell

FOR /f "tokens=2-4 delims=/ " %%a in ('DATE/T') do SET date=%%a-%%b-%%c
md %date%