This page is edited from the 1cmdfaq.txt faq-file contained in
my tscmd.zip
command line interface (CLI) collection. That zipped file has much
additional material, including a number of detached .cmd script
files. It is recommended that you also get the zipped version as a
companion.
Please see "
The Description and
the Index page" for the conditions of usage and other such
information.
36} I start a program from my script and it hogs my command window.
A question frequently presented also in a format like "
How to start windows program from batch file
without the command prompt window".
Occasionally one may want to call a program from the command line
window. Furthermore, it sometimes is useful to build calling that
program into a script e.g. for customization. However, when one
does, the command window will "freeze" to wait for the completion of
the task. How can one avoid that and free the command window for
other parallel usages? The trick is to start the program using the
START internal command.
The basic format of the start command is
START "title" command/program
Including the "title" is essential. Most questions and confusion arise
from failing to include it, even if commonly it is left empty:
START "" whatever
For example, my favorite text editor is the SemWare Editor
Professional. Below is one of the options of how I may call it. It
is a batch/script that is meant to work on both a 95 and on a XP PC.
This means that in Windows95 it must not have to encounter unknown
(CMD.EXE) lines of the batch/script. Furhermore, note the difference
in the format of calling the program with the START.
This solution is valid all through to and including Windows 10.
@echo off
:: E.BAT by Prof. Timo Salmi
:: One option for calling the SemWare Editor Professional
::
if [%OS%]==[Windows_NT] goto _nt
if [%1]==[] L:\TSEPro\e32 *.*
if not [%1]==[] L:\TSEPro\e32 %1 %2 %3 %4 %5 %6 %7
goto _out
::
:_nt
if "%~1"=="" (
start
"" "C:\Program Files\TSEPro\e32" *.*
) else (
start
"" "C:\Program Files\TSEPro\e32" %*)
::
:_out
In the above "the %* batch parameter is a wildcard reference to all
the arguments, not including %0, that are passed to the batch file."