如何设定开机自定义脚本
一、脚本功能介绍
3.1端口可以是 单个如 80 或者连续多个 9000-10000
在使用自动重装系统完成后,系统将自动执行脚本命令。无需等待安装成功后手工执行,实现一键完成系统定制化操作。
在【系统设置】-【重装系统设置】-【镜像管理列表】中,选定操作系统【点击修改】。
在脚本栏中输入复制开关机命令,则安装系统后将会自动执行。
注意:脚本根据镜像系统类型而论,各类系统不能混用,否则无效。如:windows与linux的脚本不能混用,而windows server2003与windows server2008可用同一脚本。
netsh advfirewall firewall add rule name={项目名称} protocol=TCP localport={端口} dir=in action=allow
netsh Advfirewall set allprofiles state off
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
netsh advfirewall firewall add rule name=icmp4 protocol=icmpv4 dir=in action=allow //IPV4脚本命令
netsh advfirewall firewall add rule name=icmp6 protocol=icmpv6 dir=in action=allow //IPV6脚本命令
win10\16\19(两条需一起放入) :
netsh firewall set opmode mode=disable profile=ALL
netsh firewall set opmode mode=disable
win7\08\12 :
netsh advfirewall set allprofiles state off //关闭
netsh advfirewall set allprofiles state on //开启