How can I concatenate date /t, time /t, and an argument in a batch file and append that as one line to a file?
Posted on 2011-03-11
I want a batch file that will append a file with one line that has the date and time on the line, followed by some test, but I want it all on one line. I pass in an argument that contains the text.
This is what I have now:
rem - Batch file to add a line of text to a daily notes file
date /t >> C:\dailynotes.txt
time /t >> C:\dailynotes.txt
rem - The text is argument 2
echo %1 >> C:\dailynotes.txt
This is the way it looks in my file:
How can I get those three items onto one line in the file, not three?