The cd command moves you to a different folder
To change directory in PowerShell, type cd followed by the path to the folder you want to enter. PowerShell then shows you that folder's contents when you run commands. For example, cd C:\Users\YourName\Documents moves you into your Documents folder. After you press Enter, your prompt changes to show the new location.
PowerShell uses backslashes (\) to separate folder names in a path, unlike some other command-line tools. The path always starts with a drive letter like C: or D:, followed by a colon. If you type the path wrong, PowerShell tells you the folder does not exist.
Key Takeaways
- Type cd followed by a space and the full path to move into any folder on your computer.
- Use cd .. to move up one level to the parent folder, or cd \ to jump to the root of your current drive.
- PowerShell paths use backslashes and always start with a drive letter like C: or D:.
- Tab completion fills in folder names automatically — type the first few letters and press Tab to finish the name.
- Use pwd to see your current location if you lose track of where you are in the folder structure.
Moving to a folder with the full path
The most direct way to change directory is to type the complete path from the drive letter to the folder you want. Open PowerShell and type cd C:\Users\YourName\Documents, replacing YourName with your actual username. Press Enter, and PowerShell moves you there. Your prompt now shows something like PS C:\Users\YourName\Documents> instead of your previous location.
If the folder name has spaces in it, wrap the entire path in quotes. For example, cd "C:\Program Files\My process" works, but cd C:\Program Files\My process without quotes fails because PowerShell treats the space as a separator. You can also use backticks before the space — cd C:\Program` Files\My` process — but quotes are simpler.
Using relative paths to move within your current location
You do not always need the full path. If you are already in C:\Users\YourName and want to move to the Documents folder inside it, type cd Documents. PowerShell looks for Documents inside your current location. This is called a relative path because it is relative to where you already are.
To move up one level to the parent folder, type cd .. (two dots). If you are in C:\Users\YourName\Documents, running cd .. takes you to C:\Users\YourName. You can chain them together: cd ..\..\ moves up two levels. To jump all the way to the root of your drive, type cd \ (backslash only).
Tab completion saves typing and prevents mistakes
PowerShell has a feature called tab completion that finishes folder names for you. Type cd C:\Users\ and then press Tab. PowerShell fills in the first folder name that starts after Users. Press Tab again to cycle through other folder names. This is much faster than typing the whole path and prevents typos.
Tab completion works with relative paths too. If you are in your Documents folder and type cd D and press Tab, PowerShell looks for folders starting with D inside Documents and fills in the first match. If no match exists, nothing happens — that means no folder starts with that letter in your current location.
Switching between different drives
If your computer has multiple drives — like C: for your main drive and D: for an external drive or second hard drive — you can move between them. Type cd D:\ to switch to the D drive entirely. Your prompt changes to PS D:\>. You can then navigate folders on that drive the same way you do on C:.
straightforward typing D: alone does not move you; you must include the backslash. If you type D: without the backslash, PowerShell remembers that you want to work on the D drive but does not actually change your location. Adding the backslash — D:\ — completes the move.
Checking your current location with pwd
If you have navigated through several folders and lost track of where you are, type pwd (print working directory) and press Enter. PowerShell shows your full current path. This is useful when you have multiple PowerShell windows open or when you have been moving around for a while and need to confirm your location before running a command.
The prompt itself also shows your location, but pwd is clearer if the path is very long and wraps to multiple lines on your screen. Some users also use Get-Location, which does the same thing but is longer to type.
Common mistakes and how to fix them
The most common error is typing a path that does not exist. PowerShell responds with a message like "Cannot find path 'C:\Users\YourName\Documants' because it does not exist." Check your spelling — in this example, "Documants" should be "Documents". Use tab completion to avoid this.
Another mistake is forgetting the backslash when switching drives. If you type cd D: without the backslash, you stay on your current drive. Add the backslash: cd D:\. Also remember that PowerShell is case-insensitive for folder names, so cd documents and cd Documents both work, but the path itself must be spelled correctly.
Frequently Asked Questions
What is the difference between cd and Set-Location?
They do the same thing. cd is a built-in shortcut (called an alias) for the longer command Set-Location. PowerShell accepts both, but cd is faster to type and works the same way in every situation.
Can I change to a folder on a network drive?
Yes. Type cd \\ComputerName\ShareName to move to a shared folder on another computer. Replace ComputerName with the name of the computer sharing the folder and ShareName with the name of the shared folder. You may need to enter a username and password if the network requires it.
What does the tilde (~) mean in PowerShell paths?
The tilde represents your home folder, which is usually C:\Users\YourName. You can type cd ~ to jump there quickly from anywhere. This is a shortcut that works in PowerShell and many other command-line tools.
How do I change to a folder with a special character in its name?
Wrap the path in quotes if the folder name contains spaces, parentheses, or other special characters. For example, cd "C:\Users\YourName\My (Backup) Folder". If you use tab completion, PowerShell adds the quotes automatically when needed.
Can I go back to the folder I was just in?
PowerShell does not have a built-in "back" command like some file managers, but you can type cd - in some shells. In standard PowerShell, you must type the full path or use cd .. to go up one level. Keep track of your path by using pwd before moving.