1.配置win节点,开机自动连接jenkins
创建jenkins.bat,存放于【C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup】
cd c:\jenkins start java -jar agent.jar -jnlpUrl http://172.16.22.86:8080/computer/win10_chenjy_10.8.153.226/slave-agent.jnlp -secret affcbb5ec8a7264d9edb0b3f082d5be11e8a05a675bb12c776bf2e9c11604520 -workDir "C:\jenkins"
2.配置win节点,远程命令后台执行
创建文件slave-agent.vbs,运行
DIM objShell set objShell=wscript.createObject("wscript.shell") iReturn=objShell.Run("cmd.exe /C java -jar C:/slave.jar -jnlpUrl http://10.8.225.26:8080/computer/10.8.225.136_VPN%E8%87%AA%E5%8A%A8%E5%8C%96%E5%B9%B3%E5%8F%B0/slave-agent.jnlp -secret 7e926d9bde084b3be0e365055c8b00c05b54a670d1de578c61fa9abb7762d2d4", 0, True)