batch file duration caluculation


/ Published in: Windows PowerShell
Save to your folder(s)



Copy this code and paste it in your HTML
  1. @echo off
  2. for /f "tokens=1-14 delims= " %%A in ('systeminfo ^| find "System Up Time"') do set /a secs1=86400*%%D+3600*%%F+60*%%H+%%J
  3.  
  4. rem nothing here
  5.  
  6. for /f "tokens=1-14 delims= " %%A in ('systeminfo ^| find "System Up Time"') do set /a secs2=86400*%%D+3600*%%F+60*%%H+%%J
  7. set /a secs3=secs2-secs1
  8. echo %secs3% seconds taken.
  9. pause

URL: http://www.computerhope.com/forum/index.php?PHPSESSID=19e483b837f84937b9041fc5560f2970&topic=63400.0;all

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.