Solved

Close DOS Window

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
A quick step-by-step overview of installing and configuring Carbonite Server Backup.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

828 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