The basic command to move between folders

To change directories in PowerShell, type cd followed by a space and the path to the folder you want to enter. For example, cd C:\Users\YourName\Documents moves you into your Documents folder. Press Enter, and PowerShell takes you there.

The prompt at the left side of the screen updates to show your new location. Instead of PS C:\Users\YourName>, you will see PS C:\Users\YourName\Documents>. This tells you where you are in the file system at any moment.

Key Takeaways

  • Type cd followed by the folder path and press Enter to move into that folder.
  • Use cd .. to move up one level to the parent folder, or cd \ to jump to the root of your drive.
  • Type pwd to see your current location if you lose track of where you are.
  • Folder names with spaces need quotes around them: cd "Program Files" works, but cd Program Files does not.
  • PowerShell remembers your last few locations, so you can use the up arrow key to repeat previous commands.

Moving up or back to a parent folder

Sometimes you need to go backward in the folder structure instead of forward. Type cd .. (that is two periods with no space between them) to move up one level to the parent folder. If you are in C:\Users\YourName\Documents\Work, typing cd .. takes you to C:\Users\YourName\Documents.

You can chain these together to move up multiple levels at once. cd ..\.. moves up two levels, cd ..\..\.. moves up three levels, and so on. To jump all the way to the root of your drive (the top level), type cd \. This is useful when you want to start fresh and navigate from the beginning of your drive.

Handling folder names with spaces

If a folder name contains spaces, PowerShell needs you to put the entire path in quotes. For example, cd "C:\Program Files" works, but cd C:\Program Files does not — PowerShell stops at the space and tries to interpret Files as a separate command.

You can also use quotes around just the folder name if the parent folders have no spaces. cd C:\Users\YourName\"My Documents" works just as well as cd "C:\Users\YourName\My Documents". Either way, the quotes tell PowerShell to treat the space as part of the folder name, not as a separator between commands.

Checking where you are right now

If you lose track of your location after several commands, type pwd (short for "print working directory") and press Enter. PowerShell displays your full current path on the next line. This is the same path shown in the prompt, but typing pwd is useful when the prompt is hard to read or when you want to copy your location to use elsewhere.

You can also type Get-Location to see the same information. pwd is shorter and works the same way, so most people use that instead. Both commands show you exactly where you are without changing anything.

Using relative paths to move around faster

Instead of typing the full path every time, you can use a relative path — a path that starts from where you are right now. If you are in C:\Users\YourName and you want to go to C:\Users\YourName\Documents\Work, you can type cd Documents\Work instead of the full path.

Relative paths save typing and are easier to remember when you are moving between folders that are close to each other. The trade-off is that they only work from your current location. If you move to a different folder, the same relative path points to a different place — or nowhere at all. Full paths, by contrast, work from anywhere because they start from the root of the drive.

Listing what is inside a folder before you enter it

Before you change directories, you might want to see what folders are inside the one you are about to enter. Type dir to list everything in your current folder, or dir FolderName to list what is inside a specific folder without entering it. This helps you check that the folder you want actually exists and that you spelled the name correctly.

The dir command shows file names, folder names, file sizes, and dates. Folders are marked with <DIR> in the output. Once you confirm the folder exists and you can see its exact name, you can then use cd to enter it with confidence.

Frequently Asked Questions

What if I type a folder path that does not exist?

PowerShell shows an error message: "Cannot find path 'C:\path\you\typed' because it does not exist." The error does not change your location — you stay in the folder you were already in. Check the spelling of the folder name and try again, or use dir first to see what folders are actually there.

Can I change to a folder on a different drive?

Yes. If you want to move from C: to D:, type cd D:\ to go to the root of the D drive, or cd D:\FolderName to go directly to a specific folder. PowerShell handles multiple drives the same way it handles folders on the same drive.

How do I go back to the folder I was just in?

Press the up arrow key on your keyboard to scroll through your command history. PowerShell remembers the last several commands you typed, including cd commands. Find the one you want and press Enter to run it again.

What is the difference between cd and Set-Location?

cd is a short alias for the command Set-Location. They do exactly the same thing. cd is faster to type, so most people use that instead. PowerShell accepts both.