user3611311
user3611311

Reputation: 3

Simply in .bat file in windows

I created script for install files from network place. However, I need to fix inputs from command line.

set num=
set /p num=Enter your choose: 
if "%num%"=="1" goto installJabber
if "%num%"=="2" goto installTimer
if "%num%"=="3" goto installVMWare
if "%num%"=="4" goto installOffice

How do I write "if "%num"" is not 1 or 2 or 3 or 4 then exit ?

Upvotes: 0

Views: 30

Answers (1)

Magoo
Magoo

Reputation: 80073

....
if "%num%"=="4" goto installOffice
goto :eof

:eof is recognised by batch as meaning 'the end of the batch file'. The colon is required.

Upvotes: 1

Related Questions