Introduction to the Windows command line
Windows gives you more than one way to work at the command line. The two names you are most likely to meet are Command Prompt and PowerShell.
Command Prompt
Command Prompt, commonly opened as cmd, is the traditional Windows command interpreter. It is still useful, particularly because a lot of older instructions and development tools refer to it.
PowerShell
PowerShell is a much more capable shell and scripting environment. You do not need to become a PowerShell expert before you can use it to run Python, Git or other developer tools.
Some useful Command Prompt commands
dir: list files and directories.cd folder: move into a directory.cd ..: move up one directory.mkdir name: create a directory.copy: copy files.move: move files.del: delete files. Be careful; computers are remarkably obedient.cls: clear the screen.help: show help for built-in commands.
Paths with spaces
If a path contains spaces, put it in quotes:
cd "C:\Users\Bob Smith\Documents"
Running Python
Depending on your installation, commands such as python, py and python -m pip may be useful. If Windows cannot find Python, read our PATH guide.
Command Prompt or PowerShell?
Use whichever the instructions for your tool support and whichever you are comfortable with. For new Windows automation, PowerShell is generally the more capable choice. For simply changing folder and launching a program, either can do the job.
Running something from the current folder
PowerShell has one little surprise worth knowing about. If an executable is in your current directory, you will commonly run it with .\ in front:
.\myprogram.exe
That .\ basically means "from here". We'll meet the same general idea when we talk about paths elsewhere.
Have a go
Create a folder somewhere safe, move into it from the command line, create another folder inside it, list the contents and then move back out again. Nothing dramatic needs to happen. The point is simply to get comfortable moving around without the mouse.
Further reading and external resources
For the full technical detail and current behaviour, continue with the official material below.
Previous: Introduction to the command line | Next: Introduction to the Linux command line
Using a screen reader?
Using the command line with a screen reader explains how to review terminal output with NVDA and JAWS without moving the live command prompt.
Image Description