time stamp

S

stat

Is there a way to echo or type a time stamp into a text file
I use the following batch file to export a log file fom a program I open
each day

echo ***** #### day spacer #### ******
type d:\spl.log >> d:\err.txt
echo ***** #### day spacer #### ******

is there a way to insert the time on the last line ? I use this to separate
the days so I can look back in case there is an errors I might have
overlooked as the spl.log is replaced every day

Thanks
 
G

guard

The (FREE) Advanced NT Command Library (ntlib.cmd) provides the
..Mount/\Commands ".GetTime" and ".TimeEcho", which will
CONSISTENTLY provide what you need under NT/2K/XP/K3 using only
what is available in a standard install of each platform.

GetTime - echoes hh:mm:ss AND saves the value in variable %#TIME%
GetTimeP - echoes hh:mm:ss.hs AND saves the value in variable %#TIMEP%
TimeEcho - echoes [hh:mm:ss] followed by an optional message

See (http://TheSystemGuard.com/NTCmdLib/MountCommands)
for more information.

*******

Also, see (http://TheSystemGuard.com/MtCmds/GetValue/GetLogTime.htm)
and (http://TheSystemGuard.com/MtCmds/ValueEcho) for more examples.

*******

Notes:

1. .Mount/\Commands are constructed using ONLY builtin
commands common to all four platforms (NT/2K/XP/K3).
2. .M/\C's are NOT case sensitive. Mixed case is used
for Visual Clarity only.
3. ntlib.cmd provides a sampling of over 50 .M/\C's.
You can obtain it at (http://ntlib.com).

*******

-tsg
____________________________________________________________
TheSystemGuard.com | BoomingOrFuming.com | MountCommands.com
Free and "Almost Free" Knowledge for Windows System Admins!
 

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