Home / Microsoft / Microsoft DOS / Date Stamp
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] - (Bottom) Print
Author Topic: Date Stamp  (Read 4312 times)
isko98
Guest
« 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
IP logged
isko98
Guest
« Reply #1 on: April 25, 2004, 09:24:06 PM »

btw i am using Windows NT ver 4...
IP logged
rosken
Guest
« Reply #2 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%
IP logged
Pages: [1] - (Top) Print 
Home / Microsoft / Microsoft DOS / Date Stamp « previous next »
 


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright © 2010 Computer Hope ® All rights reserved.
Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Page created in 0.062 seconds with 18 queries.