Today's date in a batch file

  • Thread starter Thread starter Spin
  • Start date Start date
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
 
Back
Top