Solved

close command prompt after executing as batch file

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Help with AsEnumerable(), LINQ 4 39
how to run this deletion request 4 21
Disable extension 8 38
i have to take the screenshot of command prompt? how to do this? 1 37
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

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