?
Solved

How can I tell how long it took a batch file to run

Posted on 2008-10-01
7
Medium Priority
?
280 Views
Last Modified: 2010-04-21
I am running an old-fashioned batch file via Task Scheduler for one particular backup.  My question is, is there a command switch or 3rd party utility that will tell me how long it took for the command to complete?

In other words, I can tell when the command started.  I want to be able to tell when it finished also.

Any and all help is very much appreciated.

Thanks!
0
Comment
Question by:garykunes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 22618319
have it write to a time stamped logfile.
0
 
LVL 11

Expert Comment

by:theProfessa
ID: 22618458
I would use a Windows Resource called Timethis.exe

If your batchfile is in C:\TEST\batch.bat you can do the following.

1.  Copy timethis.exe to C:\TEST
2.  Open command prompt window and type in cd c:\test
3.  Type "timethis.exe batch.bat" without the quotes

Hopefully this helps!
0
 
LVL 38

Expert Comment

by:Shift-3
ID: 22618464
Look in the Scheduled Tasks log.  By default this is located at %systemroot%\SchedLgU.Txt.  You can also get to it by going to Advanced|View Log from the Scheduled Tasks window.

It should list start and finish times for all tasks.
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
LVL 11

Expert Comment

by:theProfessa
ID: 22618465
0
 
LVL 11

Expert Comment

by:theProfessa
ID: 22618491
I didn't see the Task Scheduler portion of your question.  Alternatively you can incorporate timethis.exe by creating a batch file that runs the batch file.  Then schedule that to run.

Just a thought.
0
 

Accepted Solution

by:
nauthencharge earned 1000 total points
ID: 22633936
I just had to do something like this, so I had the script create a log file, placing a timestamp before and after the command.  I have placed code below.

echo ******************** >> log.txt
echo Copy Started on %DATE% %TIME% >> log.txt
echo ******************** >> log.txt
REM PLACE YOUR CODE HERE
echo ******************** >> log.txt
echo Copy Finished on %DATE% %TIME% >> log.txt
echo ******************** >> log.txt

Open in new window

0
 

Author Closing Comment

by:garykunes
ID: 31502135
Great solution.  Thanks so much for your help.  This is EXACTLY what I needed.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Suggested Courses
Course of the Month14 days, 15 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question