ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Adding text 'silently'?

<< < (2/2)

akx:
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...

--- ---@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

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!

rgdot:
Thank you akx, will try that as well

rjbull:
A simple "take note" batch file, let us call it takenote.bat
[...]
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.
-akx (May 30, 2009, 12:46 PM)
--- End quote ---

If you can run to an extra little program, take a look at Horst Schaeffer's LOGECHO from his freeware PBATS collection


--- ---LOGECHO 2.2 (c) 1997 Horst Schaeffer
ECHO using time/date information (case sensitive tokens):
$D  day (01..31) $h  hour
$M  month (01..12) $m  minutes
$N  month (Jan..Dec) $s  seconds
$H  month (hex 1..C) $c  sec/100
$Y  year (00..99)
$C  century (19|20)
$W  day of week (Sun..Sat)
$V  day of week (0..6)
$Z  day of year (001..366)
$$  '$'
$+  new line

which would allow you to enter times and dates however you like.

rgdot:
Another option to explore, thanx

Navigation

[0] Message Index

[*] Previous page

Go to full version