Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Batch file help needed
Name: atcusick Date: February 24, 2005 at 09:43:12 Pacific OS: XP CPU/Ram: P4 3 gb
Comment:
I am attempting to create a log file that appends the system date to the file name in order to avoid renaming the file each time the batch is run. This is being attempted in the shortcut's command line.
For example
$$$$.BAT > C:\test.log 2>&1
How would I append the system date without doing it manually? I attempted syntax such as $$$$.BAT > "C:\test"%DATE% to be left with results of: test Thu
The date output is terminated after the blank space in what should be"Thu 02/24/2005"
Any help would be appreciated, I am avoiding writing a VB program if possible. Changing the date format without modifying config would be nice too. Thanks!
creates test_02_24_2004.log with all error messages written to file. Problem solved. Thanks for taking time to look.
0
Response Number 2
Name: Michael J (by mjdamato) Date: February 24, 2005 at 12:56:32 Pacific
Reply:
When creating log files the preferred method is to use YYYY MM DD so that the files will be sorted chronologically. Just a suggestion - do what works for you.
Michael J
0
Response Number 3
Name: Mechanix2Go Date: February 24, 2005 at 23:42:19 Pacific
Reply:
Michael,
Good point.
I never have worked out why Americans persist in the use of DD in the middle.
Or AM/PM time notation.
M2
0
Response Number 4
Name: Guy Date: February 25, 2005 at 07:52:00 Pacific
Reply:
One caution: the default format of %DATE% and %TIME% will be different in Win2K and XP.
Default formats are controlled in the registry.
Guy
0
Response Number 5
Name: Mechanix2Go Date: February 25, 2005 at 08:06:23 Pacific
Summary: I need a batch file to copy files from 1 location to another on a network daily. The only problem I have is I dont know the exact folder the files are in as they is generated randomly. The folder cont...
Summary: Hi, new to this forum, hoping someone can help me with a pretty simple batch file. I need to go through a directory and rename every folder in it, from the original name to original name.gif. Yes, the...
Summary: Hi, I need help with a batch file, i need it to delete all folders, subfolders and files from C:\Documents and Settings except for four folders named: All Users Default User LocalService NetworkServic...