user2819346
user2819346

Reputation:

Batch with Echo messages and then normal CMD

I have a simple batch file:

ECHO OFF
CLS
ECHO WELCOME
ECHO.
ECHO Launching your app...

What I would like is to return to a default CMD state where the user can type commands, I mean, this state: C:[path][path].....>
I want to give to the user the possibility to continue to type anything he wants after the echo "Launching your app..." So visually it would give this:

WELCOME
Launching your app...
C:[path][path][path]> _

Upvotes: 1

Views: 708

Answers (1)

MC ND
MC ND

Reputation: 70923

@echo off
    rem check if started from own process (use our own parameter)
    rem and if not, spawn a new cmd with correct parameters and 
    rem keep it open

    if not "%~1"=="__startcmd__" (
        "%comspec%" /k "%~f0" __startcmd__ %* 
        exit
    )

    rem eliminate custom parameter of parameter list
    shift

    rem your custom screen
    cls
    title "command window"
    prompt $p$g
    echo WELCOME
    echo Launching your app ...

Upvotes: 1

Related Questions