Computer Hope

Microsoft => Microsoft DOS => Topic started by: silvrwood on October 17, 2008, 01:54:31 PM

Title: Output Date to File
Post by: silvrwood on October 17, 2008, 01:54:31 PM
I've tried to output the system date to a file, and it does output the date, but the cmd window never closes because it's waiting for input.  How do I output the date to a file either supplying an enter to the system, or bypassing the prompt in a .bat file?
Title: Re: Output Date to File
Post by: Sidewinder on October 17, 2008, 02:56:30 PM
Code: [Select]
date /t > datefile.txt

That will eliminate the prompt.

 8)
Title: Re: Output Date to File
Post by: Dias de verano on October 17, 2008, 03:46:54 PM
alternative:

Code: [Select]
echo %date% > datefile.txt
Title: Re: Output Date to File
Post by: silvrwood on October 20, 2008, 11:41:27 AM
Wonderful!  Thanks so much!
 ;D
Title: Re: Output Date to File
Post by: johnsonbben on November 22, 2008, 07:57:40 PM
Code: [Select]
echo %date% >filename.txt
Title: Re: Output Date to File
Post by: Dias de verano on November 23, 2008, 02:13:35 AM
Why did you duplicate a post made on October 17th, johnsonben?