1.

Solve : Log results of bat file with timestamp name.?

Answer»

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.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. I looked in that link, there doesn't seem to be any information about logging, or creating logs from your batch file.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.



Discussion

No Comment Found