Показват се публикациите с етикет bat file. Показване на всички публикации
Показват се публикациите с етикет bat file. Показване на всички публикации

16.04.2015 г.

Use mstsc with menu options with bat file

Create file.bat and put text:



@echo off
SET /P myVariable="Choice options: 1 - First 2 - Second 3 - Third"

echo
if %myVariable%==1 goto :First 
if %myVariable%==2 goto :Second 
if %myVariable%==3 goto :Third 



:First 
echo "Set First "
cmdkey /generic:ip /user:username /pass:passwords & mstsc.exe /v:ip
exit

:Second 
echo "Set Second "
cmdkey /generic:ip /user:username /pass:pass:passwords & mstsc.exe /v:ip

:Third 
echo "Set Third "
cmdkey /generic:ip /user:username /pass:pass:passwords & mstsc.exe /v:ip


Bat file to change ip address

Create file change_bat_brat.bat with content:

@echo off
echo.......................................................
color 2
ipconfig | find "IPv4 Address"
echo ......................................................

set /p num1=Enter a number: 1 - First 2 - Second
echo
if %num1%==1 goto :First
if %num1%==2 goto :Second
:First
echo Choice First
netsh interface ip set address name="Local Area Connection" static 192.168.168.111 255.255.255.0 192.168.168.1 1
netsh interface ip set dns "Local Area Connection" static 1.1.0.1
exit

:Second
echo Choice Second
netsh interface ip set address name="Local Area Connection" static 192.168.10.111 255.255.255.0 192.168.10.1 1
netsh interface ip set dns "Local Area Connection" static 192.168.10.1
exit