New
#10
fixed the tutorial's example because of code errors and missing commands
remade the example to Showing differance between using the start command than just running a path by itself.
-Example 1-
ECHO OFF
CLS
:MENU
ECHO.
ECHO ...............................................
ECHO PRESS 1, 2 OR 3 to select your task, or 4 to EXIT.
ECHO ...............................................
ECHO.
ECHO 1 - Open Notepad
ECHO 2 - Open Calculator
ECHO 3 - Open Notepad AND Calculator
ECHO 4 - EXIT
ECHO.
SET /P M=Type 1, 2, 3, or 4 then press ENTER:
IF %M%==1 GOTO NOTE
IF %M%==2 GOTO CALC
IF %M%==3 GOTO BOTH
IF %M%==4 GOTO EOF
:NOTE
CLS
ECHO Opening Notepad
start notepad.exe
GOTO MENU
:CALC
CLS
ECHO Opening Calculator
start calc.exe
GOTO MENU
:BOTH
CLS
ECHO Opening Notepad
start notepad.exe
ECHO Opening Calculator
start calc.exe
GOTO MENU
:EOF
EXIT
-Example 2-
CLS
ECHO.
ECHO ...............................................
ECHO PRESS 1, 2 OR 3 to select your task, or 4 to EXIT.
ECHO ...............................................
ECHO.
ECHO 1 - Open Notepad
ECHO 2 - Open Calculator
ECHO 3 - Open Notepad AND Calculator
ECHO 4 - EXIT
ECHO.
SET /P M=Type 1, 2, 3, or 4 then press ENTER:
IF %M%==1 GOTO NOTE
IF %M%==2 GOTO CALC
IF %M%==3 GOTO BOTH
IF %M%==4 GOTO EOF
:NOTE
CLS
ECHO Opening Notepad
%windir%\notepad.exe
GOTO MENU
:CALC
CLS
ECHO Opening Calculator
%windir%\system32\calc.exe
GOTO MENU
:BOTH
ECHO Note: The notepad will run first then when its closed the calculator will run afterwards.
pause
CLS
ECHO Opening Notepad
%windir%\notepad.exe
ECHO Opening Calculator
%windir%\system32\calc.exe
GOTO MENU
:EOF
EXIT
Note: Can the OP fix the 1st post has made mistakes that even confused me.
Last edited by Bubbadama123; 11 May 2016 at 22:14.