Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to start an external program an continue MSDOS script?

8,908 views
Skip to first unread message

Kurt Mankel

unread,
Jun 20, 2009, 4:11:37 AM6/20/09
to
From a MSDOS batch script under WinXP I want to call (=Start) an external program say aaaa.exe
with GUI interface.

When I siply enter the line

aaaa.exe

in the script then this prgm is call but script stops execution until the program is exit.

How can I call/start the program but continue with the script?

Kurt

Pegasus

unread,
Jun 20, 2009, 4:25:50 AM6/20/09
to

You supplied the answer yourself: Use the Start command!

@echo off
start /b "My GUI Program" "c:\Program Files\aaa.exe"

Stubbo of Oz

unread,
Jun 20, 2009, 4:54:34 AM6/20/09
to


I do it this way:-

start aaaa.exe
rest of commands in script


--
----------------
Stubbo of Oz
----------------

Andrew

unread,
Jun 20, 2009, 2:30:14 PM6/20/09
to
Kurt Mankel schrieb:

depending on your rights as a user try it like this instead of writing

aaaa.exe

write

start aaaa.exe


for more information open a cmd shell and enter start /?


Andrew

Timo Salmi

unread,
Jun 20, 2009, 4:27:09 PM6/20/09
to
Andrew <vnc_s...@t-online.de> wrote:
> write
> start aaaa.exe

Not quite. This has been discussed time and again:
START "" aaaa.exe

See e.g.
http://www.netikka.net/tsneti/info/tscmd036.htm#start

All the best, Timo

--
Prof. Timo Salmi mailto:t...@uwasa.fi ftp & http://garbo.uwasa.fi/
Hpage: http://www.uwasa.fi/laskentatoimi/english/personnel/salmitimo/
Department of Accounting and Finance, University of Vaasa, Finland
Useful CMD script tricks http://www.netikka.net/tsneti/info/tscmd.htm

Alto

unread,
Jun 20, 2009, 10:52:43 PM6/20/09
to
On Sat, 20 Jun 2009 23:27:09 +0300, Timo Salmi <t...@uwasa.fi> wrote:

>Andrew <vnc_s...@t-online.de> wrote:
>> write
>> start aaaa.exe
>
>Not quite. This has been discussed time and again:
> START "" aaaa.exe
>
>See e.g.
>http://www.netikka.net/tsneti/info/tscmd036.htm#start
>

I would appreciate advice as to what terrible things can happen if the
"" is left out of the command line. The above reference does not shed
any light on this and it has always worked well without the "" for me.

Thank you ..........

--
Alto
NSW Australia

Sjouke Burry

unread,
Jun 20, 2009, 11:24:03 PM6/20/09
to
In command window,
>start /?

foxidrive

unread,
Jun 20, 2009, 11:55:59 PM6/20/09
to

If you quote the path and filename, without the "", then it will not work.

The first quoted pair become a label for the window.

Todd Vargo

unread,
Jun 21, 2009, 12:52:53 AM6/21/09
to

Right, Timo's help page does not quite explain this situation. Also IMO, the
E.bat on that page provides unnecessary/confusing information to explain
START usage.

Rule #1, the START command in Windows 2K/XP treats the first quoted
parameter as a title (Windows 9X/ME did not have the title feature). If
program aaaa.exe were to include any spaces in the name, then it would
require to be quoted. Without the empty "", START will treat the quoted
program name as a title, and therefore throw an error. However, if the
program does not need to be quoted as in the case of aaaa.exe, it is ok to
exclude the empty quotes, however in Windows 2K/XP, it is good practice to
include them so as to remember Rule #1.

start abc.exe <= correct
start "" abc.exe <= correct
start "" "a b c.exe" <= correct
start "a b c.exe" <= this will fail

--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)


Alto

unread,
Jun 21, 2009, 1:33:23 AM6/21/09
to

Thanks Todd - great explanation!

Cheers ..............
--
Alto
NSW Australia

Timo Salmi

unread,
Jun 21, 2009, 2:12:21 AM6/21/09
to

Tim Meddick

unread,
Jun 21, 2009, 11:17:03 AM6/21/09
to
Use the 'start' command (that is what it's there for) use the command :

start /?

...at the prompt for usage instructions.


e.g.

@echo off
start aaaa.exe
echo Aaaa.exe has been started...

==

Cheers, Tim Meddick, Peckham, London. :-)


"Kurt Mankel" <km...@hotmail.com> wrote in message
news:4a3c99b9$0$31342$9b4e...@newsspool4.arcor-online.net...

Kurt Mankel

unread,
Jun 22, 2009, 2:40:41 PM6/22/09
to
Hmm, no matter wether I code

start java -jar .....

or

start "" java -jar .....

a command prompt window stays always alive.

How can I continue MSDOS batch script AND exit the calling script?


On Sat, 20 Jun 2009 20:30:14 +0200, Andrew <vnc_s...@t-online.de>
wrote:

Pegasus

unread,
Jun 22, 2009, 3:45:16 PM6/22/09
to
On 22 June, 20:40, Kurt Mankel <km...@hotmail.com> wrote:
> Hmm, no matter wether I code
>
> start java -jar .....
>
> or
>
> start "" java -jar .....
>
> a command prompt window stays always alive.
>
> How can I continue MSDOS batch script AND  exit the calling script?
>
> On Sat, 20 Jun 2009 20:30:14 +0200, Andrew <vnc_serv...@t-online.de>

> wrote:
>
> >Kurt Mankel schrieb:
> >> From a MSDOS batch script under WinXP I want to call (=Start) an external program say aaaa.exe
> >> with GUI interface.
>
> >> When I siply enter the line
>
> >> aaaa.exe
>
> >> in the script then this prgm is call but script stops execution until the program is exit.
>
> >> How can I call/start the program but continue with the script?
>
> >> Kurt
>
> >depending on your rights as a user try it like this instead of writing
>
> >aaaa.exe
>
> >  write
>
> >start aaaa.exe
>
> >for more information open a cmd shell and enter start /?
>
> >Andrew

You need to use a process launcher other than a batch file.
CScript.exe is one such launcher. Try the VB Script below. I've
wrapped it into a batch file so that you can add other commands before
and after the launcher.

@echo off
set sProg=c:\program files\java.exe
set sParm=-jar ...
set Scr=c:\TempVBS.vbs
set VB=echo^>^>%Scr%
cd 1>nul 2>%Scr%
%VB% Set WShell = WScript.CreateObject("WScript.Shell")
%VB% WShell.Exec "" ^& "%sProg%" ^& " " ^& "%sParm%" ^& ""
cscript //nologo %Scr%
del %Scr%

Todd Vargo

unread,
Jun 22, 2009, 5:36:48 PM6/22/09
to

"Kurt Mankel" <km...@hotmail.com> wrote in message
news:gtjv35t0t06l20bqq...@4ax.com...

> Hmm, no matter wether I code
>
> start java -jar .....
>
> or
>
> start "" java -jar .....
>
> a command prompt window stays always alive.
>
> How can I continue MSDOS batch script AND exit the calling script?

Put EXIT on the line following the START command.

0 new messages