Solved

Close DOS Window

Posted on 2011-03-05
2
401 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
2 Comments
 
LVL 95

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

810 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