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

Author Topic: Log results of bat file with timestamp name.  (Read 5787 times)

0 Members and 1 Guest are viewing this topic.

Iauruth

  • Guest
Log results of bat file with timestamp name.
« on: August 04, 2004, 10:27:52 AM »
I have done a search on the front page, and in the forums, and I couldn't find out how to do this.

I want to log the results on a bat file I run, and save it in a specific folder with the date and time as a name. Example: "2004.08.04-13.27.log"

The batch file I have runs a program, which displays it's results in the open dos window, and then connects and uploads a file to and ftp server. I want to take all the information displayed on the dos file, create and store it in a log file.

I don't know how to copy what is displayed, and save it to a file.

Thanks for your help.

johnwill

  • Guest
Re: Log results of bat file with timestamp name.
« Reply #1 on: August 04, 2004, 12:50:02 PM »
Well, for many (most?) DOS applications, simply redirecting the output will do it.  For instance, the command:

DIR >C:\LISTING.TXT

... creates the directory listing in C:\LISTING.TXT.

http://garbo.uwasa.fi/pc/batchutil.html has a ton of DOS command line utilities, I'll bet something there will do the trick. :)

Iauruth

  • Guest
Re: Log results of bat file with timestamp name.
« Reply #2 on: August 04, 2004, 03:30:34 PM »
I looked in that link, there doesn't seem to be any information about logging, or creating logs from your batch file.

johnwill

  • Guest
Re: Log results of bat file with timestamp name.
« Reply #3 on: August 04, 2004, 04:09:13 PM »
Well, it's a giant collection of utilities, that's all.  When I wanted what you seek, I wrote a 10 line C program to do the job. :)