How to Restart a Windows Process Using PowerShell
Restarting a process with PowerShell, meaning stopping it and starting it again, is useful when an application or background task needs a fresh start. While there is no single restart command for arbitrary processes, PowerShell makes the stop-and-start sequence straightforward.
The Command
Stop-Process -Name "notepad" -Force; Start-Process "notepad"
What It Does
This runs two commands in sequence, separated by a semicolon. `Stop-Process -Name “notepad” -Force` ends all Notepad instances, and `Start-Process “notepad”` launches a fresh one. Together they effectively YYGACOR restart the program. The `-Force` ensures the process stops even if unresponsive, and the semicolon lets both commands run on one line.
When You’d Use This
This suits situations where a background task or application needs a fresh start, such as after changing its configuration or when it has become unresponsive but you want it running again immediately. Doing both steps in one line is convenient in scripts. For Windows services specifically, the single `Restart-Service` command is cleaner than stopping and starting manually.
Useful Variations
Replace “notepad” with the process you want to restart, using its name without the .exe. For a Windows service rather than an application, `Restart-Service -Name “ServiceName”` does the whole restart in one command. To restart Windows Explorer specifically, stopping explorer.exe usually prompts Windows to relaunch it automatically.
If It Doesn’t Work
If the process does not restart, confirm the name is correct, without the .exe, and that you have rights to stop it, running as administrator if needed. Forcing a stop loses unsaved work, so this suits background tasks rather than programs holding documents. For services, prefer `Restart-Service`, which manages dependencies better than manually stopping and starting the underlying process.
Good to Know
Stopping a process with `-Force` discards any unsaved work in it, so this suits background tasks or deliberate restarts rather than programs holding unsaved documents. For system services, prefer `Restart-Service`, which handles dependencies more gracefully than manually stopping and starting a process.
Putting It Together
The command shown may look dense at first, but it breaks down into clear parts once you have used it a few times. As part of understanding and controlling what runs on your PC, this command is one you will return to whenever the system feels slow or a program misbehaves. Paired with the related process commands, it gives you a full command-line alternative to Task Manager for diagnosing and managing what is running. Like anything in the terminal, the real value comes from trying it on your own system and adapting the variations above to what you actually need, so it is worth experimenting with in a safe, low-stakes situation before relying on it in a script or during troubleshooting. Keeping a note of the commands you find most useful, along with the variations that fit your workflow, turns scattered one-off tricks into a personal reference you can draw on whenever a similar task comes up again.