Run a batch or vbs file

Posted on 2006-03-21
Last Modified: 2008-01-09
Hi to all,

I'm stuck with this .....

I need to run a batch or vbs file to start two aplications ......


I'm using the following :

@echo off



The only problem is when App_a starts the batch waits and only if i close the App_a it runs the App_b ....

I need to run both at the same time and exit/close the batch file ....

Question by:MiguelSilvestre
    LVL 59

    Accepted Solution

    I believe you need to use the START command (without the /WAIT parameter) to do this.  Here is some info on the START command:


    Start a specified program or command in a separate window.

          START "title" [/Dpath] [options] [command] [parameters]

       WHAT to run

       path       : Starting directory
       command    : The NT Command, Batch file or executable program to run
       parameters : The parameters passed to the command

       HOW to run it

       /MIN       : Minimized
       /MAX       : Maximized
       /WAIT      : Start application and wait for it to terminate
       /LOW       : Use IDLE priority class
       /NORMAL    : Use NORMAL priority class
       /HIGH      : Use HIGH priority class
       /REALTIME  : Use REALTIME priority class
       "title"    : Text for the CMD window title.
       /B         : Start application without creating a new window. In this case
                    ^C will be ignored - leaving ^Break as the only way to
                    interrupt the application
       /I         : Ignore any changes to the current environment.

       Options for 16-bit WINDOWS programs only

       /SEPARATE   Start in separate memory space (more robust)
       /SHARED     Start in shared memory space (default)

    Although ["title"] is supposedly an optional parameter, when it is omitted other options may be interpreted as being the title - so to be absolutely sure just put something in like "My Script".

    Document files may be invoked through their file association just by typing the name of the file as a command.
    e.g. START WORD.DOC would launch the application associated with the .DOC file extension

    A new printer can be installed very quickly (and the driver downloaded) with the command
    START \\print_server\printer_name

    Setting a Working Directory
    To start an application and specify where files will be saved

    START /Dc:\Documents\ /MAX notepad.exe

    Note that START /D does not support long filenames which contain spaces, a workaround is to use the 8.3 compatible name(s)

    Forcing a Sequence of Programs
    If you require your users to run a sequence of 32 bit GUI programs to complete a task, create a batch file that uses the start command:

    @echo off
    start /wait /b <First.exe>
    start /wait /b <Second.exe>
    start /wait /b <Third.exe>

    Create a shortcut to this batch file and place it on the Start menu or desktop. Set it to run minimized.
    When the user double-clicks the shortcut, <First.exe> runs.
    When <First.exe> terminates, <Second.exe> runs
    When <Second.exe> terminates, <Third.exe> runs

    An alternative method is to run a .BAT batch file under (16 bit)

    If Command Extensions are disabled, the START command will no longer recognise file Associations, and will not automatically evaluate the COMSPEC variable when starting a second CMD session.

    Missing file extensions
    When executing a command line whose first token does NOT contain an extension, then CMD.EXE uses the value of the PATHEXT environment variable to determine which extensions to look for and in what order. The default value for the PATHEXT variable is:


    Notice the syntax is the same as the PATH variable, with semicolons separating the different elements.

    When executing a command, if there is no match on any extension, then NT will look to see if the name, without any extension, matches a directory name and if it does, the START command will launch Explorer on that path.

    "Do not run; scorn running with thy heels" - Shakespear, The Merchant of Venice

    Related commands:

    CALL - Call one batch program from another
    CMD - can be used to call a subsequent batch and ALWAYS return even if errors occur.
    GOTO - jump to a label or GOTO :eof

    Q162059 - Opening Office documents

    Equivalent Linux BASH commands:

    .period - Run commands from a file
    LVL 15

    Author Comment

    Hi LeeTutor,

    I do this :

    @echo off

    START "title_1" "%PROGRAMFILES%\something.exe"
    START "title_2" "C:\Program Files\something_2.exe" /q


    And works great :))



    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

    Disclosure: Use this tutorial only when no other options helps to get Windows XP running without any problems and you don't want to format the drive. The back up of the data is the responsible of the user, however there is a description of how t…
    Step by step guide to Clean and Sort your windows registry! Introduction: Always remember: A Clean registry = Better performance = Save your invaluable time In this article we're going to clear our registry manually! Yes, manually! The e…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    734 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