Link to home
Start Free TrialLog in
Avatar of pattersonr
pattersonr

asked on

Batch File to Run Program and Output Time Finished

I am looking to find a way to write a batch file to run an executable.  This exectuable will run for several hours converting a SQL database from one version to another.  We expect that this process will take approximately 5 hours.  I would like to be able to create the batch file in such a way that once the program has completed its task, it will create a file with the date and time that the program stopped.  In reality, all I need (minimally) is for after the program is completed, just for the batch program to create a file.  This will have a date and time created stamp on the file.  The operating system will be on windows 2000 server.

(As a side note, I am not stuck to the idea of batch files only,  if someone can come up with a better way, that would be acceptable as well)

I am a novice at batch files.  The syntax for such a file would be greatly appreciated.  Thanks
Avatar of sriduttmiraskar
sriduttmiraskar

Hey Pattersonr,
   Using Batch file is itself a good idea, because it will not execute next statement in the batch file, until it is done with the current statement.  For example : For simplicity your batch file consists of following statements...

c:
md abc
copy e:\*.* abc
deltree /y abc

In this case even deltree statement takes less time and copy statement takes more time comparitively, it will wait for the completion of copy statement.

This way you will be able to do your job without using timer/indicators....

Regards Dutt.
ASKER CERTIFIED SOLUTION
Avatar of errorx666
errorx666

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pattersonr

ASKER

Thanks..That was exactly what I was looking for. I needed just enough syntax to help me fill in the values.  Perfectly answered.

Thanks again