(services, usual tasks are NOT executed in interactive mode)
Use the Sysinternals tool Autologon for that.
Execute the following script once for the session to be started automatically.
"C:\Program Files (x86)\Sysinternals\Autologon.exe" YOURUSER . YOURPASS
Use Jenkins-Swarm-Plugin for that,
Execute the following script to connect a machine to a Jenkins as a Slave. The slave will have label “sikuli” . Name this script addSwarmSlaveToJenkins.bat and use it in the next chapter.
java -jar C:\temp\EXP_swarm\swarm-client-2.2-jar-with-dependencies.jar -executors 2 -fsroot c:\Jenkins -labels "sikuli %ComputerName%" -master http://10.0.0.198:5555 -name farm-%ComputerName% -username YOURUSER -password YOURPASS
Use the Windows Task Scheduler for that.
Execute the following script once to create a task, which will be executed, when the user logs in. Explicitely at Autologon too.
schtasks /Create /RU YOURUSER /RP YOURPASS /SC ONLOGON /TN "Connect to Jenkins as swarm slave" /TR c:\temp\EXP_swarm\addSwarmSlaveToJenkins.bat /IT
Here you can download the plugins manually in HPI form, to install them manually https://updates.jenkins-ci.org/download/plugins/
Useful to make nodes add themselves to the Jenkins:
THe problem is - Jenkins kills spawned processes together with the job. Solution: use a wrapper script. https://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build
But indeed no wraper would work reliably, because its a feature of jenkins named “ProcessTreeKiller” which is reponsible for killing the preocesses. This feature can be disabled:
https://wiki.jenkins.io/display/JENKINS/ProcessTreeKiller
@echo off ::start server via a wrapper script, so that Jenkins does not complain about leaking handler https://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build set ANTRUN_OUTPUT="C:\tmp\StartWeblogicTOI.html" C:\tmp\wrapperScript.js "C:\tmp\startTOICmd.bat" :: wait until it is up and running set serverisRunning="" :whileWaiting if %serverisRunning% == "" ( echo Waiting for server to start sleep 10 for /f %%i in ('Findstr /I /M /C:"state changed to running" C:\tmp\StartWeblogicTOI.html') do set "serverisRunning='%%i'" goto :whileWaiting ) time /T echo Server is running now