Run Azure self hosted agent as service

Open a Command Prompt as an administrator.
Run the following
sc createcommand to create the service:
sc create my-agent binPath= "C:\Windows\System32\cmd.exe /c C:\agent\run.cmd"
- If you want to configure the service to start automatically with Windows, you can run the following
sc configcommand:
sc config my-agent start= auto
- Start the service using the
sc startcommand:
sc start my-agent
Ensure that you're running these commands directly within the Command Prompt and not within a PowerShell session to avoid any issues with command interpretation.
If you continue to encounter any issues, please provide more details, and I'll be happy to assist further.




