Solved

close command prompt after executing as batch file

Posted on 2013-02-01
4
1,018 Views
Last Modified: 2013-02-02
Hi Experts,

Probably I am asking very stupid question. But I can't do it anyway.

I put a batch file in windows startup, from where one exe is called. Thats it. I need to close the batch file after invoking that exe. The problem is the command prompt is stay opened after invoking that exe. How to close that command prompt (i.e. dos window)?

Please help,

Soumen
0
Comment
Question by:Soumen-Roy
[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 43

Accepted Solution

by:
Steve Knight earned 500 total points
ID: 38846212
if it is only one exe you could run it instead of the batch but if you want to do it in the batch then use the START keyword.  that makes it run the other app then carry on straight away, normally in a batch if you run an exe you want it to wait and do them in order.

with start the first parameter in quotes is the window title so if you need quotes because of spaces in exe path or name then use:

start "" "c:\program files\.....yourexe.exe"

or

start c:\shortpath\yourexe.exe

hth

Steve
0
 
LVL 7

Expert Comment

by:karunamoorthy
ID: 38846290
You can try this sample batch file

=========
TITLE My batch file
:: content here
start calc
GOTO :END
:END
FOR /l %%a in (5,-1,1) do (TITLE %TITLE% -- Closing in %%as&ping -n 2 -w 1 127.0.0.1>NUL)
:: then, explicit exit (not required)
exit /B 1 >nul
==========

The above batch file opens calc program and closes dos box after 5 seconds. You can modify this to suit your requirement
0
 

Author Closing Comment

by:Soumen-Roy
ID: 38846292
thanx, its just what i expected.
thanx a lot
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 38846713
no problem.

steve
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
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…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

623 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