Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dos command to print message, date & time (same line)

Status
Not open for further replies.

twinmom

Programmer
Mar 22, 2002
4
US
Using Windows 2000 Professional OS:

I have been trying to use a DOS command to create a type of log file. This file would include a message indicating that my process completed along with the date and time (on the same line).

I've tried:

a)echo process completed - %date% %time% >>c:\outfile.txt

b)echo process completed - >>c:\outfile.txt
date /t >>c:\outfile.txt
time /t >>c:\outfile.txt

Option (a) gives me all of the information on a single line except that the time is a military time and I want a standard time.

Option (b) produces a standard time but it also writes each piece of information on a separate line and I cannot figure out how to combine all of this information onto a single line.

Please help me to either change the time in option (a) to a standard time or concatenate all of the information in option (b) to a single line. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top