Solved

Close DOS Window

Posted on 2011-03-05
2
427 Views
Last Modified: 2012-05-11
I have a batch job that kills a task and the restarts it after 5 minutes. I have tried to name it with a .bat and .cmd extension, but I cannot get it to close that DOS window after it runs. Can anyone help with this please?

taskkill /f /im MyProgram.exe
ping 1.1.1.1 -n 1 -w 300000
C:\ MyProgram.exe
exit
0
Comment
Question by:rjackmanwyn
[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
2 Comments
 
LVL 96

Accepted Solution

by:
Lee W, MVP earned 500 total points
ID: 35044546
Use Start - Batch files pause execution until the command run is finished... so it's paused until MyProgram.exe is finished.  Using start should start the program and continue executing the batch file:

start "" "C:\MyProgram.exe"

(The first " block is the program title - as above, it leaves the program name empty)

for illustration purposes
start "My Program's Title" "C:\MyProgram.exe"
0
 

Author Closing Comment

by:rjackmanwyn
ID: 35044617
That did it thank you
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

634 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