Posted By

simondiercks on 06/30/10


windows batch duration

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


batch file duration caluculation

 / Published in: Windows PowerShell


  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
  4. rem nothing here
  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  


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

This should be batch, not powershell.

Posted By: OliviaU on September 14, 2016

Great post. Thanks for sharing. Olivia at

Posted By: on August 23, 2018

facemoji app for android emojikeyboardzone

You need to login to post a comment.