HOME
Stephen Knight
08/23/2012
08:20 PM
Time taken for batch file to execute
Type:
VBScript, Batch/Command file
Category:
Batch, Uptime, VBScript, Time
This script uses a small vbscript line to time a batch file. You can Start / Stop the timer and count how many secs, mins, hours between the two times - they can be on different days if needed and span midnight as it records date & time.
Another option is to use
If you replace the subroutines section with this it will make the date and time within a VBScript. Swap the words day( and month( to get it in mm/dd/yyyy format instead.
Alternate subroutines to get date using VBScript as otherwise it is dependent on system date format in %date%
Alternative Start and End subroutines for date format including the day name:
:START
set start=%date:~4% %time:~0,8%
echo START at %start%
exit /b
:END
set end=%date:~4% %time:~0,8%
echo END at %end%
exit /b
Code
Explanation
Examples
Attachments