Batch File to Run Program and Output Time Finished

Posted on 2003-03-13
Medium Priority
Last Modified: 2010-04-17
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
Question by:pattersonr
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

Expert Comment

ID: 8130032
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...

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.

Accepted Solution

errorx666 earned 200 total points
ID: 8131767
@echo off
echo Executing program...
REM Run the program
echo Execution complete.
REM Create the file
REM > will send the output of echo directly into myfile.log
echo The operation has completed successfully. > myfile.log

Author Comment

ID: 8131864
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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This is about my first experience with programming Arduino.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Introduction to Processes
Suggested Courses

770 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