设置为DHCP
netsh interface ipv4 set address name="office" source=dhcp
netsh interface ipv4 set dns name="office" source=dhcp
设置为STATIC
netsh interface ipv4 set address "office" source=static addr=192.168.4.249 mask=255.255.255.0
netsh interface ipv4 set dns "office" source=static addr=172.28.0.2
自动关机
@echo off
::at 20:35 /every:M,T,W,Th,F,S,Su shutdown -s -t 60 -c "Too late,it's time to get off work!"
at 20:45 /every:M,T,W,Th,F,S,Su shutdown -s -f
echo Done!
pause&end
route添加与删除
route delete -p 0.0.0.0 mask 0.0.0.0 192.168.4.250
route add -p 192.168.0.246 mask 255.255.255.255 192.168.4.250 if 10
netsh interface ipv4 add address "test" 192.168.3.168 255.255.255.0
route add -p 192.168.1.1 mask 255.255.255.255 192.168.0.234 if 12
网络配置与自动化关机
本文介绍了如何使用命令行工具进行网络配置,包括设置DHCP和静态IP地址、DNS服务器,以及路由表的管理和修改。此外,还提供了一个简单的批处理脚本实现计算机的定时自动关机。
5316

被折叠的 条评论
为什么被折叠?



