Solved

close command prompt after executing as batch file

Posted on 2013-02-01
4
1,013 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

Independent Software Vendors: 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

This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

739 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