Until now I’ve been calling all things typed into Command Prompt a “command” (or the arguments following). In reality, most commands are not built into Command Prompt’s code, but instead separate programs that Command Prompt blindly runs on your command.
All programs can be ran from Command Prompt. Programs in Windows generally have a
.exe file extension. If you navigate your working directory to a folder containing an
exe, and you type that executable file name as a command, then the program will run.
To run any program, simply:
- Navigate your working directory to it
- Enter the program’s name
Console vs GUI
Most programs fall into the two categories:
- Graphical User Interface (GUI) with windows, buttons to click, etc
- Console/command line interface, only can be ran in a console window, outputs text
If you try to run a graphical program in Command Prompt, it will simply open up and ignore Command Prompt. Doing this is usually not desired, but it can be done. For example, Microsoft’s Notepad program has a GUI but it can also accept a file name argument. So you can enter
notepad test.txt and notepad will open up and create a new file named
test.txt in your working directory.
Conversely, if you ever double click a program and see a command prompt window flash up and go away very quickly, you know you’ve just clicked a console-based program. Open up Command Prompt and run the program there instead to see what text was outputted. Most readers probably have not seen this before. It’s not important to have seen this but if you’re curious:
- Open a GUI folder explorer window and click your way to
- Open “schtasks.exe”. This is your console-based scheduled tasks program that comes with Windows. It is only useful in Command Prompt since it outputs text and closes.
- In Command Prompt,
C:\Windows\System32and run “schtasks.exe”. See what you just missed in step 2.