troubleshooting Question

DateTime in batch file

Avatar of huskeraider
huskeraiderFlag for United States of America asked on
Microsoft DOS
13 Comments1 Solution501 ViewsLast Modified:
Currently i use the following to create a random log file:

set logfile = logfile%random%.txt

then i can send info to %logfile%

I'm trying to change it so my set lines gives me a current date format like 20101009.txt (currentdate.txt)

then i can send info to %logfile% and get a text file with the current date

I thought it was set logfile = %curdate%.txt
then i could send info to  > %logfile% and have it show up in the directory as 20101009.txt.

Is there a web site that explains how to do this?

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 13 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 13 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros