Posted By

simondiercks on 06/30/10


Tagged

windows batch duration


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Tyster


batch file duration caluculation


 / Published in: Windows PowerShell
 

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

  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

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: Vordreller on June 30, 2010

This should be batch, not powershell.

You need to login to post a comment.