?
Solved

How do I close the cmd window automatically after running a batch file from another batch file, exit doesnt work?

Posted on 2009-04-15
2
Medium Priority
?
576 Views
Last Modified: 2012-08-14
Im using a batch file to run some commands stored in another batch file, by using the start command. However after the second batch file has been run the window of the first one remains open. I have tried to add an exit command at the end of the first batch, but it changes nothing. How do I close all the command windows after processing?
0
Comment
Question by:Suppai
[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 85

Accepted Solution

by:
oBdA earned 2000 total points
ID: 24145956
What *exactly* are you trying to do?
To call another batch script from your current one, you can simply use
call TheBatch.cmd
The scripts will then all run in the same window; what happens with the window after the script is finished depends on how the script was started:
* if it was started from an open command prompt, this command prompt will by default stay open (which is useful, especially when testing the script; plus a script/program actually has no business closing a command prompt it didn't open itself).
* if it was started through a doubleclick in Explorer or from the Run menu, the window will close automatically after it's finished.
0
 

Author Closing Comment

by:Suppai
ID: 31570328
The call command did the trick. Apparently the start command isnt appropriate for running other batch scripts sequentially.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

We have adopted the strategy to use Computers in Student Labs as the bulletin boards. The same target can be achieved by using a Login Notice feature in Group policy but it’s not as attractive as graphical wallpapers with message which grabs the att…
When you receive another warning that your shared drive is almost full and you have asked your users to clean out old files again and again, here is a single command that may help. This command will place all the files that have not been used rec…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
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

770 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