Share this article
Improve this guide
Command Prompt basics: Starting and stopping processes
2 min. read
Published onAugust 17, 2020
published onAugust 17, 2020
Share this article
Improve this guide
Read our disclosure page to find out how can you help Windows Report sustain the editorial teamRead more
In this article
Toggle
Command Prompt basics: Starting and stopping processes
Using the Command Prompt can be a quick way to launch programs, especially Windows management utilities which might be fiddly to find through search.
We’ll look at a few basic procedures for working with programs and processes.
Launching programs
To launch a program from Command Prompt, simply type its name:
notepad
This will launch a new Notepad instance. The example works because Windows already knows where Notepad is. Command Prompt automatically searches the working directory (the path shown at the start of the prompt line) and Windows system directories when you run a program in this way.
When the executable resides elsewhere, you’ll need to specify its entire path –C:WindowsSystem32notepadin this example.
An alternative way to launch programs is via thestartcommand:
start notepad
This has the same effect as the above example. However, the launch mechanism is slightly different – Command Prompt will hand off to Windows itself, which will take care of finding the right program. More locations will be searched, including the entire contents of thePATHenvironment variable and “app path” shortcuts defined in the registry (a way of shortening long executable paths using aliases).
Chaining commands
You can chain commands by combining them with an&character:
dir & notepad
This will display the contents of your working directory in the terminal and then open Notepad.
A variation can be achieved using&&instead:
dir && notepad
In this form, the second command will only run if the first one executes successfully. Were there to be an error listing your directory contents, Notepad would not open. (Note: You can achieve the inverse using||, sodir || notepadwould run Notepad only if thedircommand failed.)
Ending processes
You can also use the Command Prompt to end processes. This is ideal when you need to kill a program but don’t have a mouse to hand, or Task Manager itself is being unresponsive.
taskkill /F /IM “notepad.exe” /T
The above command will immediately kill any running instance of Notepad. Subsitutenotepad.exefor the name of the program you’d like to kill. You can get this information by runningtasklistto view a list of all the currently running processes.
Radu Tyrsina
Radu Tyrsina has been a Windows fan ever since he got his first PC, a Pentium III (a monster at that time).
For most of the kids of his age, the Internet was an amazing way to play and communicate with others, but he was deeply impressed by the flow of information and how easily you can find anything on the web.
Prior to founding Windows Report, this particular curiosity about digital content enabled him to grow a number of sites that helped hundreds of millions reach faster the answer they’re looking for.
User forum
0 messages
Sort by:LatestOldestMost Votes
Comment*
Name*
Email*
Commenting as.Not you?
Save information for future comments
Comment
Δ
Radu Tyrsina