Correct restart and stopping of services via command prompt!?
To correctly start, stop or restart services in Windows from the command prompt, there are several commands you can use. Here are the main steps and commands:
- `net` command: Basic start and stop operations.
- `sc` command: Advanced configuration and control.
- `taskkill` : For forcing the termination of processes.
These steps are useful for managing services without a graphical user interface.
Windows does not provide a direct command to restart a service. However, you can stop the service first and then start it:
net stop <service name> && net start <service name>
Example:
net stop spooler && net start spooler
(This command restarts the print spooler service.)
4.) Use `sc` command for more control
The `sc` command allows you to perform detailed operations on services.
- Stop service:
sc stop <service name>
- Start service:
sc start <service name>
- Force service to stop:
taskkill /F /PID <process ID>
(Useful if a service cannot be stopped normally. Use `tasklist` to determine the process ID.)
5.) View list of services
If you are not sure what name a service has, you can list all services:
sc query
6.) Change service settings (startup type)
To change the startup type of a service, use the `sc config` command.
- Manual start:
sc config <service name> start=demand
- Automatic start:
sc config <service name> start=auto
- Deactivating a service:
sc config <service name> start=disabled
Note: Make sure to use the exact service name (not the display name). You can find out the service name through the Services Manager (`services.msc`).
7.) Command prompt as administrator
All the above commands require running the Command Prompt with administrator privileges. To do this, right-click on the Command Prompt and select "Run as administrator" .
8.) Windows Server and Desktop OS command compatibility:
Yes, the commands described work on both Windows Server (including versions like 2025 , 2022 , 2019 , 2016 ) and the desktop versions of Windows ( Windows 12 , 11 , 10 , etc.). Here is a detailed overview of compatibility and special notes depending on the system:
1. Command compatibility
- `net start` and `net stop`
- Supported systems:
Works on Windows Server 2025, 2022, 2019, 2016, 2012 R2 as well as Windows 12, 11, 10, 8.1 and older.
- Note: These commands are universal and have been proven to work across many versions of Windows.
- `sc` (Service Control) commands
- Supported systems:
Works on Windows Server 2025, 2022 as well as all desktop versions such as Windows 12, 11, 10 .
- Special functionalities: Allows more granular service controls and configurations, such as changing the startup type (automatic, manual, disabled).
- `taskkill` (kill processes)
- Supported systems:
Fully compatible with Windows Server and desktop versions , including Windows 12 and Server 2025 .
- Note: Used to stop dead services or processes if `net stop` or `sc stop` fails.
- `sc query`
- Supported Systems:
Lists services on all server and desktop versions.
2. Special notes for Windows Server
- Server-specific services:
Windows Server versions often have additional services such as Active Directory Domain Services (AD DS) or Internet Information Services (IIS) . These can also be controlled using the commands described.
- Remote administration:
On servers, services can also be administered using PowerShell or Remote Desktop . However, for `net` and `sc`, it makes no difference whether you work locally or remotely.
- Advanced security policies:
On servers, security policies can restrict certain commands. Administrator rights are always required.
3. Special notes for Windows 12, 11 and 10
- Standard services:
All standard services such as Windows Update , print queue (spooler) or Windows Defender can be easily managed using the commands described.
- PowerShell as an alternative:
In newer versions of Windows, PowerShell is preferred as a more powerful alternative to the command prompt. The corresponding PowerShell commands would be:
- Stop service:
Stop-Service -Name <service name>
- Start service:
Start-Service -Name <service name>
- Restart service:
Restart-Service -Name <service name>
4. Conclusion
The commands `net` , `sc` , and `taskkill` work reliably on Windows Server 2025 , 2022 as well as Windows 12 , 11 , 10 and earlier versions. For advanced use on servers or new Windows versions , PowerShell offers additional functionality but is not a mandatory requirement.
(Image-1) Correct restart and stopping of services via command prompt!?
A Windows computer can be shut down or restarted quickly and efficiently using the command prompt. This method is especially useful when other control methods
The fastest way to run or start the command prompt in every Windows System, is via RUN-Dialog in Windows 11, 10, and MS Server. Please start via Keyboard-Shortcut
The solution to scan all protected system files and replaces incorrect versions with correct Microsoft versions in all Windows 10, 11, . and Server Systems.
This website does not store personal data. However, third-party providers are used to display ads, which are managed by Google and comply with the IAB Transparency and Consent Framework (IAB-TCF). The CMP ID is 300 and can be individually customized at the bottom of the page. more Infos & Privacy Policy ....