未找到相关内容
帮助中心

如何设定开机自定义脚本

来源:智简魔方     发布人:智简魔方     时间:2019-11-14 18:49    

一、脚本功能介绍

二、使用开机自定义脚本

三、winodws常见脚本

        3.1端口可以是 单个如 80 或者连续多个 9000-10000

        3.2关闭防火墙

        3.3开启远程桌面连接 参数 0为开 1为关

        3.4修改远程连接端口

        3.5远程桌面安全验证(不要开启网络级别的身份验证)

        3.6关闭禁ping ,windows默认的规则禁ping

1.脚本功能介绍

    在使用自动重装系统完成后,系统将自动执行脚本命令。无需等待安装成功后手工执行,实现一键完成系统定制化操作。


2.使用开机自定义脚本

    在【系统设置】-【重装系统设置】-【镜像管理列表】中,选定操作系统【点击修改】。

image.png

    在脚本栏中输入复制开关机命令,则安装系统后将会自动执行。

image.png

注意:脚本根据镜像系统类型而论,各类系统不能混用,否则无效。如:windows与linux的脚本不能混用,而windows server2003与windows server2008可用同一脚本。


    3.windows常见脚本

    3.1端口可以是 单个如 80 或者连续多个 9000-10000

    netsh advfirewall firewall add rule name={项目名称} protocol=TCP localport={端口} dir=in action=allow


    3.2关闭防火墙

    netsh Advfirewall set allprofiles state off


   3.3开启远程桌面连接 参数 0为开 1为关

    reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f


    3.4修改远程连接端口

    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


    3.5远程桌面安全验证(不要开启网络级别的身份验证)

    0 为允许任何链接  1为仅允许安全的连接

    reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v "UserAuthentication" /t REG_DWORD /d "0" /f


    3.6关闭禁ping ,windows默认的规则禁ping


    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脚本命令

    3.7  默认关闭防火墙

     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 //开启