Batch File to create text in a file

G

Guest

I have a batch file that I run nightly. To verify that it completed properly
I would like to add a line of text that would write the date and time to a
text file when it finishes doing its thing. IS there a commmand line I can
add to the bottom of my code in order to do this?

Thank you.
 
D

David H. Lipman

date /t >> c:\YourFile.txt

--
Dave




| I have a batch file that I run nightly. To verify that it completed properly
| I would like to add a line of text that would write the date and time to a
| text file when it finishes doing its thing. IS there a commmand line I can
| add to the bottom of my code in order to do this?
|
| Thank you.
 
S

Stan Brown

in
microsoft.public.windowsxp.general:
I have a batch file that I run nightly. To verify that it completed properly
I would like to add a line of text that would write the date and time to a
text file when it finishes doing its thing. IS there a commmand line I can
add to the bottom of my code in order to do this?

echo %date% %time% >>logfile
 
G

GTS

There are a number of ways to do this, but the simplest is
date /T>>MyFile
time /T>>MyFile
--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top