Home > Back-end >  How to automatically close cmd window after when i choose the option?
How to automatically close cmd window after when i choose the option?

Time:07-09

@echo off
cls
:start
echo.
echo 1. Multiplayer
echo 2. Singeplayer
echo.
echo.
set /p x=Pick:
IF '%x%' == '%x%' GOTO Item_%x%

:Item_1
start /MIN /D"D:\games\Battlefield 2142 - Deluxe Edition\mods\bf2142\Tools\BF2142Unlocker64" BF2142Unlocker.exe
GOTO Start

:Item_2
start /MIN /D"D:\games\Battlefield 2142 - Deluxe Edition" BF2142_offline_4gb.exe
GOTO Start

i'm trying to solve it but i am noob shortcuts take up a lot of space on the desktop so I'm trying to run it with bat file

CodePudding user response:

Change it to

start /MIN /D"D:\games\Battlefield 2142 - Deluxe Edition" BF2142_offline_4gb.exe
exit 

CodePudding user response:

The command exit might be what you want to use

CodePudding user response:

@echo off
cls
:start
echo.
echo 1. Multiplayer
echo 2. Singeplayer
echo.
echo.
set /p x=Pick:
IF '%x%' == '%x%' GOTO Item_%x%

:Item_1
start /MIN /D"D:\games\Battlefield 2142 - Deluxe Edition\mods\bf2142\Tools\BF2142Unlocker64" BF2142Unlocker.exe
GOTO Start
exit

:Item_2
start /MIN /D"D:\games\Battlefield 2142 - Deluxe Edition" BF2142_offline_4gb.exe
GOTO Start
exit

i already tried like that but didn't work

  • Related