@echo off
mode con lines=30 cols=60
%1 mshta vbscript:CreateObject(“Shell.Application”).ShellExecute(“cmd.exe”,"/c %~s0 ::","",“runas”,1)(window.close)&&exit
cd /d “%~dp0”
cd \
Set zabbix_server_ip=IP
mkdir c:\zabbix
mkdir c:\zabbix\log
mkdir c:\zabbix\win
xcopy \共享文件夹IP\share\zabbix_agents_3.4.0.win c:\zabbix\ /s
if %processor_architecture% EQU x86 copy /y C:\zabbix\bin\win32 C:\zabbix\win
if %processor_architecture% EQU AMD64 copy /y C:\zabbix\bin\win64 C:\zabbix\win
::安装zabbix_agent
C:\zabbix\win\zabbix_agentd.exe -i -c C:\zabbix\conf\zabbix_agentd.win.conf
net start “Zabbix Agent”
::入站规则
netsh advfirewall firewall add rule name=“zabbix_agent_10050” dir=in protocol=tcp action=allow localport=10050
::出站规则
netsh advfirewall firewall add rule name=“zabbix_agent_10050” dir=out protocol=tcp action=allow localport=10050