?
Solved

I wish to close one batchfile window with another batch file in Windows Dos

Posted on 2003-03-17
4
Medium Priority
?
589 Views
Last Modified: 2007-12-19
I have a batch file that calls two other batchfiles called start_batch.bat


start /min e:\somedir\some.bat

start /min e:\otherdir\other.bat


.....


I'd like a batchfile called stop_batch.bat

??close e:\somedir\some.bat

?close e:\otherdir\other.bat



I'm having trouble finding the ??Close command that I can use.
0
Comment
Question by:jayrod
[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
4 Comments
 
LVL 1

Expert Comment

by:kcid
ID: 8152760
the command you can use is: exit
Look up the options for exit in dos by typing: exit /?

Greetings,

Kcid
0
 
LVL 3

Author Comment

by:jayrod
ID: 8153058
Nope that doesn't do it.. What I have is... One window open running a process.

I open a second window and I'd like to kill the first window. The only way I can think to do it is to call the batch as a service and use a net stop argument but I was hoping to not have to do that.

Any other ideas?

Thank you for the input though
0
 

Accepted Solution

by:
pjbcba earned 200 total points
ID: 8153395
Can't think of a way of doing this how you propose, without using other scripting tools/languages.. do you want to go down that route?

Otherwise, there may be a possible way around this..
 - The files SOME.BAT and OTHER.BAT are running continously.. so are they looping? If so, are you able to modify these files, or are they provided by someone else?

 - If they are looping and you can edit them... put a flag check within the loop of these batch files, eg:
IF EXIST E:\SOMEDIR\STOP.DAT GOTO END

Then modify the start batch to this:
IF EXIST E:\SOMEDIR\STOP.DAT DEL E:\SOMEDIR\STOP.DAT
start /min e:\somedir\some.bat

So the stop batch would just be:
ECHO. >E:\SOMEDIR\STOP.DAT

If the files aren't looping.. then I can only think of using some other tool like AutoIT, or a scripting language like VBScript or Kixtart.
0
 
LVL 3

Author Comment

by:jayrod
ID: 8153825
I was hoping to do this without having to modify the existing batch files but This answer is the closest.

thank you
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
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…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

752 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