Solved

Close DOS Window

Posted on 2011-03-05
2
387 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

760 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now