windows
create an agent in Jenkins

install
install as a service
start service
[!DANGER] for v2.0
removed:
Stop supporting .NET Framework 2.0 for launching agents, 4.0 is the minimum required version (#43) @NextTurn
Windows Support Policy in Jenkins New features and improvements
JENKINS-60005, JENKINS-61862 - Switch to the .NET Framework 4.0 for WinSW distribution (#43) @NextTurn
open the node connection page -> Launch -> File -> Install as a server

setup jenkins-slave.exe

install and start service by cmd -> sc.exe
[!NOTE]
use
instsrvinstead ofsc.exe:
Run
path\to\instsrv"Jenkins Slave"path\to\srvany.exeRun
regeditCreate
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Jenkins Slave\ParametersAdd the following registry keys:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Jenkins Slave\Description="Jenkins Continuous Integration Slave"
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Jenkins Slave\Parameters\AppParameters="-jar path\to\slave.jar -jnlpUrl http://jenkins-master:8080/computer/jenkins-slave/slave-agent.jnlp"
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Jenkins Slave\Parameters\Application="C:\WINDOWS\system32\java.exe"

[!TIP]
Configure Slave Service to Run as Domain User (Windows Server 2008 R2 x64)
regex:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurePipeServers\winregInstall Slave as a Windows service (cmd version)
<serviceKey>is the name of the registry key that will define the service (this will not be displayed)
<service>display name is the label that will identify the service in the service manager interfacealso can be checked in
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\<serviceKey>
service configuration
list all services
setup service

remove service

[!TIP] or remove
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\jenkins
prepare
download agent.jar
download winws.exe and rename
create xml
[!TIP] tips on xml label
<onfailure action="restart" />:onfailure action="restart"
<download from="https://jenkins.sample.com/jnlpJars/agent.jar" to="%BASE%\agent.jar"/>:
2022-11-30 06:31:38,022 INFO - Downloading: https://jenkins.sample.com/jnlpJars/agent.jar to J:\jenkins\agent.jar. failOnError=False
install and start agent service
[!TIP]
check available cli commands

stop services
tools
[!TIP] if Environment Variable changed in jenkins agent, the service requires to reboot again.
curl
[!NOTE|label:references:]
via scoop
via chocolatey
via manually
download from https://curl.se/windows
manually extract ( i.e.
c:\tools\curl)add
c:\tools\curl\bininto Environment Variablerestart jenkins agent service
RETURNARCHITECTURESYSTEM TYPEDOWNLOAD9x64 (AMD64)
x64-based PC64-bit5ARM
ARM64-based PCARM640x86
x86-based PC32-bit
Q&A
a windows service must first be installed ( using installutil.exe )
a windows service must first be installed ( using installutil.exe )
[!TIP]
references:
Last updated
Was this helpful?
