There are multiple approaches to starting & stopping Jenkins on Windows OS. We have to follow some steps to run Jenkins on Windows.
APPROACH-1
Using Command Prompt: To start Jenkins
Step 1: Open the command prompt on your Windows with administrative privileges.
Step 2: After opening a command prompt, run one command to start Jenkins
net start Jenkins
Using Command Prompt: To stop Jenkins
Step 1: Open the command prompt on your Windows with administrative privileges.
Step 2: After opening a command prompt, run one command to stop Jenkins
net stop Jenkins
Using Command Prompt: To restart Jenkins
Step 1: Open the command prompt on your Windows with administrative privileges.
Step 2: After opening the command prompt, run two commands to restart Jenkins
net stop Jenkins
net start Jenkins
APPROACH-2
Using the Jenkins service wrapper: To start/stop/restart Jenkins
This approach we can use only if Jenkins is already installed on our windows, then we will be able to manage it through the Jenkins service wrapper.
Step 1: We have to find the default location where Jenkins is installed on our system.
Go to the Jenkins installation directory (C:\Program Files (x86)\Jenkins).
Step 2: In the above location we will find an exe file (i.e., Jenkins.exe). jenkins.exe. We will use this file along with commands to start/stop/restart Jenkins.
Jenkins.exe start
Jenkins.exe stop
Jenkins.exe restart