Today's date in a batch file

R

Randall Flag

Roger said:
MountCommands.com

hi

for NT machines you can use


in batch:

for /f %%i in ('time /t') do set gottime=%%i

in command prompt

for /f %i in ('time /t') do set gottime=%i

to set the actual time to a env variable

or to write it to a log file:

for /f %%i in ('time /t') do echo action done at: %%i >>logfile.txt


where in Windows XP you just can use

echo %time% >>logfile.txt

hope this helps you out
 

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