D
D
dyacenko4292021-11-25 14:01:46
cmd/bat
dyacenko429, 2021-11-25 14:01:46

How to make a permanent selection of an item in the bat menu?

My code looks like this

chcp 1251 >nul
@echo off
color 71
cls
chcp 1251 >nul
:start
chcp 1251 >nul
echo Select server
echo 1. 61 - 1
echo 2. 62 - 2
echo 3. 63 - 3
echo 4. 64 - 4
echo 5. 65 - 5
echo 0. Exit - 0
echo.
set /p choice= Enter the number of the desired item:
rem if not '%choice%'=='' set choice=%choice:~0;1%
if '%choice%'=='1' goto 1
if '%choice %'=='2' goto 2
if '%choice%'=='3' goto 3
if '%choice%'=='4' goto 4
if '
if not '%choice%'=='' echo "%choice%" invalid entry
echo

goto start
:1
mstsc/v:server IP
pause
goto start
:2
mstsc/v:server IP
pause
goto start
:3
mstsc/v: server IP
pause
goto start
:4
mstsc/v:server IP
pause
goto start
:5
mstsc/v:server IP pause goto
start
:
0
exit you need to close this to select item 2

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question