16
General Software Discussion / Re: Adding text 'silently'?
« on: May 30, 2009, 12:46 PM »
A simple "take note" batch file, let us call it takenote.bat, that also notes the date and time (Windows XP and above, I think, due to the command extensions used) would be...
Basically, what that does is take the user's entered note (takenote Feed the cats!) if given, or shows the current todo.txt file if no parameters are given (takenote).
The only con I can think of here is that the date and time are somewhat messily on separate lines. I'm not that hot on the syntax for Windows's batch files to make it concatenate those on only one line.
Hope that helps!
@echo off
if x%* == x goto e
date /t >> todo.txt
time /t >> todo.txt
echo %* >> todo.txt
echo ------------------------ >> todo.txt
goto q
:e
start todo.txt
:q
if x%* == x goto e
date /t >> todo.txt
time /t >> todo.txt
echo %* >> todo.txt
echo ------------------------ >> todo.txt
goto q
:e
start todo.txt
:q
Basically, what that does is take the user's entered note (takenote Feed the cats!) if given, or shows the current todo.txt file if no parameters are given (takenote).
The only con I can think of here is that the date and time are somewhat messily on separate lines. I'm not that hot on the syntax for Windows's batch files to make it concatenate those on only one line.
Hope that helps!