bat-配置ip、关闭防火墙、启用远程桌面

@echo off&setlocal enabledelayedexpansion&title Init Server

echo ===========Start Set Network===========
:start
cls
echo ===========Start Set Network===========
echo.请输入IP:
set /p ip=
echo.请输入网关:
set /p gateway=
echo.请输入子网掩码:
set /p netmask=
echo.请输入DNS:
set /p dns=
echo.正在设置ip:
netsh interface ip set address "以太网" static %ip% %netmask% %gateway%
echo.正在设置DNS:
Netsh interface IP Set dns "以太网" static %dns% primary
echo ===========Finish Set Network===========
echo ===========Start Close Firewall===========
netsh advfirewall set allprofiles state off
echo ===========Finish Close Firewall===========
echo ===========Start Set Remote===========
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
echo ===========Finish Set Remote===========
pause
posted @ 2020-09-17 17:27  iblk  阅读(556)  评论(0编辑  收藏  举报