Send to a Friend

XOIIO's avatar

How can I get a batch file to type the current time/date to a text file?

Asked by XOIIO (18328points) September 19th, 2010

I know you use “TYPE example >filename” to add or place text into a filename, but hoe can I get it to put a variable in.

I’ve tried “TYPE %TIME% >filename” but it always messes up.

I also need it to use any variable I want it to use text from any vaiable such as
“set /p note=
if ’%note%’==‘2’ GOTO b
if ’%note%’==‘1’ GOTO a”

and put the text from the user input into a text file.

Also if you know of a command to display all the text froma certain text file that would be great. Thanks.

Using Fluther

or

Using Email

Separate multiple emails with commas.
We’ll only use these emails for this message.