3.5.5 开机脚本相关命令
本文整理常用的开机脚本命令,您可以将以下命令粘贴到操作系统开机脚本中,系统将会自动执行。
配置位置
在【系统设置】-【重装系统设置】-【镜像管理列表】中,选定操作系统并点击【修改】,将以下命令复制到脚本栏中,安装系统后将会自动执行。

放行端口
端口可以是单个端口(如 80),也可以是连续端口范围(如 9000-10000)。
netsh advfirewall firewall add rule name={项目名称} protocol=TCP localport={端口} dir=in action=allow关闭防火墙
netsh Advfirewall set allprofiles state off开启远程桌面连接
参数 0 表示开启,1 表示关闭。
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f修改远程连接端口
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp" /v "PortNumber" /t REG_DWORD /d "{端口}" /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v "PortNumber" /t REG_DWORD /d "{端口}" /f配置远程桌面安全验证
0 表示允许任何连接,1 表示仅允许安全连接。
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v "UserAuthentication" /t REG_DWORD /d "0" /f允许 ICMP ping
netsh advfirewall firewall add rule name=icmp4 protocol=icmpv4 dir=in action=allow
netsh advfirewall firewall add rule name=icmp6 protocol=icmpv6 dir=in action=allow