Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: TimeStamp on the Log file  (Read 3257 times)

0 Members and 1 Guest are viewing this topic.

kalyan

  • Guest
TimeStamp on the Log file
« on: October 19, 2004, 04:07:30 PM »
Hi,

I am trying to schedule a batch file to run at specific intervals and i am trying to run a command line utility.

I am redirecting the output into a log file log.txt

i need to get the time stamp in the file name like
logMMDDYYHHMMSS.txt

I am not particular about the order of the time stamp.


Can anybody help me in creating this batch file as desired.

Thanks
Kalsee

kalyan

  • Guest
Re: TimeStamp on the Log file
« Reply #1 on: October 19, 2004, 04:11:19 PM »
by the way the OS is windows 2000

Richard Hadley

  • Guest
Re: TimeStamp on the Log file
« Reply #2 on: October 20, 2004, 06:04:22 AM »
I use the lines below. This will write 4 lines to the end of the log file, showing date, time, reason and a few dashes for spacing.

echo. |date /t >> e:\logs\log.txt
echo. |time /t >> e:\logs\log.txt
echo. Reason for Log >> e:\logs\log.txt
echo. ---------- >> e:\logs\log.txt

kalyan

  • Guest
Re: TimeStamp on the Log file
« Reply #3 on: October 20, 2004, 10:07:32 AM »
Hi Richard,

Thanks for spending time to reply for my query.

But Here is what i am looking for.

I am trying to name the log file with the time stamp.

Example : G:\LogMMDDYYHHMMSS.txt

that way i'll have a new file created each time the batch file is fired. and all the file names will be unique.

Thanks
Kalyan