Solved

close command prompt after executing as batch file

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

759 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now