Dual command on batch file menu -


i new of this, took me hours make following:

@echo off cls echo=========================================================================== echo                                    menu echo=========================================================================== echo........................................................................... echo                        type 1,2 or 3 press enter: echo........................................................................... echo. echo 1 - server xxx.xxx.xxx.1 echo 2 - server xxx.xxx.xxx.2 echo 3 - exit echo.  set /p opt=type 1,2 or 3 press enter: if %opt%==1 goto mstsc 1 if %opt%==2 goto mstsc 2 if %opt%==3 goto eof  :mstsc 1 mstsc.exe /v:xxx.xxx.xxx.1 /admin /f goto eof  :mstsc 2 mstsc.exe /v:xxx.xxx.xxx.2 /admin /f goto eof  :eof exit 

when select options 1 , 3 work fine, when select option 2 same result option 1. it's not connecting second server, how can fixed? how can have command prompt close command executed? command prompt closes after close mstsc.

thank all.

also since first attempt @ batch file please tell me of mistakes can learn.

label names can't have spaces in them. first case works "by accident". use mstsc_1 , mstsc_2 labels example.


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -