How to Change Directory in PowerShell? [Step-by-Step Guide]
If you’re new to PowerShell, one of the first things you’ll want to learn is how to change directories.
A directory is simply another name for a folder. When you open PowerShell, it starts in a particular location, such as your user profile folder. If you want to work with files stored somewhere else, you’ll need to move to that folder first.
For example, you might want to access your Downloads folder, open a project stored on another drive, or run a command inside a specific directory. PowerShell makes these tasks easy once you understand a few basic commands.
In this guide, you’ll learn how to change directories in PowerShell, move between folders, switch drives, return to a previous location, and troubleshoot common errors.
How to Change Directory in PowerShell?

To change a directory in PowerShell, use the Set-Location command or its shortcut, cd, followed by the path of the folder you want to open. For example, enter cd C:\Users and press Enter to move to the Users folder on your C: drive.
You can also use cd .. to move up one directory, cd \ to move to the root of the current drive, and D: to switch to the D: drive.
Let’s look at each method in detail.
Step 1: Open PowerShell on Your Windows PC
Before changing directories, you need to open PowerShell. Windows 11 and Windows 10 provide several ways to launch it.
Click the Start menu and type PowerShell in the search box. When Windows displays the PowerShell app, click it to open the command-line window.
You can also press Windows + X to open the Quick Link menu. Depending on your Windows configuration, you may see Terminal or Windows PowerShell. Select the available option.
If Windows Terminal opens, you can use its PowerShell tab to enter the same commands described in this guide.
Once PowerShell opens, you’ll see a prompt followed by a path. For example, it might look like this:
PS C:\Users\Liam>
The path tells you your current directory, which is the folder PowerShell is working in right now. Your username and starting location may be different.
You don’t need to open PowerShell as an administrator just to change directories. A regular PowerShell session is enough for everyday folder navigation.
Step 2: Use the cd Command to Change Directories
The easiest way to change directories in PowerShell is by using the cd command. It is a shortcut for Set-Location, which tells PowerShell to move to a different location.
Suppose you want to move to the Users folder on your C: drive.
Type the following command:
cd C:\Users
Press Enter to execute it.
PowerShell will change its current location to C:\Users. Your prompt should now show the new directory.
For example:
PS C:\Users>
That’s it. You have successfully changed directories.
You can use the same method for other folders. If you want to access a folder named Documents directly under your user profile, enter its full path.
cd C:\Users\Liam\Documents
Replace Liam with your actual Windows username. If your Documents folder is redirected to OneDrive or stored somewhere else, use its actual location.
Remember that the folder must exist. If you enter an incorrect path, PowerShell will display an error instead of changing directories.
Step 3: Change Directories Using Set-Location
Although cd is shorter and easier to type, PowerShell also supports the full Set-Location command.
For example, to open your Downloads folder, you can enter:
Set-Location C:\Users\Liam\Downloads
Press Enter, and PowerShell will move to that folder.
The result is the same as using the cd command. Both commands change the current location of your PowerShell session.
You can also use the command with a relative path. For example, if your current directory is C:\Users\Liam, entering the following command moves into the Documents subfolder.
Set-Location Documents
This works because PowerShell looks for the Documents folder inside your current directory.
For beginners, using cd is usually more convenient because it requires less typing. However, learning Set-Location is helpful when reading PowerShell scripts or working with more advanced commands.
Step 4: Move to the Parent Directory
Sometimes, you may need to move up one level instead of opening another folder. For example, if you’re currently inside C:\Users\Liam\Documents and want to return to C:\Users\Liam, you can use the parent-directory command.
Enter:
cd ..
Press Enter.
PowerShell will move up one directory level. The two periods represent the parent directory, which is the folder immediately above your current location.
You can also move up multiple levels by using the command more than once.
For example:
cd ..\..
This moves up two directory levels, provided those parent directories exist.
If you’re working inside a deeply nested folder, this method can save you from typing the entire path back to the parent folder.
Be careful when using relative paths because the result depends on your current directory. If you’re unsure where you are, check the prompt or use Get-Location.
Step 5: Switch Between Different Drives
Changing directories and switching drives are closely related, but they are not exactly the same thing in PowerShell.
Suppose you’re working on the C: drive and want to access files stored on the D: drive.
You can use the following command:
D:
Press Enter to switch to the D: drive’s current PowerShell location.
If you want to open a particular folder on that drive, enter its full path instead.
cd D:\Projects
This command takes you directly to the Projects folder on the D: drive.
You can also use the full Set-Location command.
Set-Location D:\Projects
If the D: drive doesn’t exist on your computer, or the folder path is incorrect, PowerShell will report an error.
One useful detail is that PowerShell can remember the previous location associated with a drive. For example, switching back to C: may return you to the directory you last used on that drive. To open a specific folder reliably, provide its full path.
Step 6: Open a Folder Whose Name Contains Spaces
Folder names sometimes contain spaces. For example, you might have a folder called My Projects or Windows Tools.
If you enter a path with spaces without quotation marks, PowerShell may interpret the path incorrectly.
To avoid this issue, enclose the complete path in quotation marks.
For example:
cd “C:\Users\Liam\My Projects”
Press Enter, and PowerShell will move to the specified folder.
You can also use quotation marks with the full command.
Set-Location “C:\Users\Liam\Windows Tools”
This approach works with both single-quoted and double-quoted paths in ordinary cases. Double quotation marks are a convenient choice for beginners.
If you frequently work with folders containing spaces, get into the habit of quoting the entire path. This helps prevent errors when navigating folders or running commands.
Step 7: Return to Your Previous Directory
PowerShell provides a handy way to return to the previous location you visited.
Enter the following command:
cd –
Press Enter.
PowerShell will attempt to switch back to the previous location in your session. You can use this when moving between two working directories and want to switch back and forth quickly.
For example, suppose you’re working in C:\Projects and then move to D:\Reports. Using cd – can take you back to the previous location.
This is particularly useful when managing files across different folders.
Keep in mind that cd – is not the same as moving to the parent directory. If you want to go one level up, use cd … If you want to return to the previous location, try cd -.
Step 8: Check Your Current Directory
If you’ve run several commands and lost track of your current location, PowerShell provides a simple way to check it.
Type:
Get-Location
Press Enter.
PowerShell will display your current working directory. For example, the result might show:
Path
—-
C:\Users\Liam\Documents
This command is useful when you’re troubleshooting a failed command or working with scripts that depend on files in a particular folder.
You can also use the shorter command:
pwd
In PowerShell, pwd is an alias for Get-Location.
Before running a command that reads, creates, or modifies files, checking the current directory can help you confirm that you’re working in the intended location.
Common PowerShell Directory Errors
If PowerShell refuses to change directories, the most common cause is an incorrect path.
First, check that the drive and folder names are spelled correctly. For example, if you enter cd C:\User when the actual folder is C:\Users, PowerShell won’t find the requested location.
Second, check whether the folder actually exists. You can list the contents of your current directory by running:
Get-ChildItem
This command displays files and folders in the current location. Look for the folder you want to open and use its exact name.
Third, use quotation marks if the path contains spaces. For example:
cd “C:\Program Files”
Finally, check that the drive is available. An external drive may not be connected, and a network location may be unavailable.
If you still receive an error, read the complete message. It often tells you whether PowerShell cannot find the path or lacks access to the requested location.
FAQs
1. What is the command to change directories in PowerShell?
Use cd followed by the folder path. For example, cd C:\Users changes the current directory to the Users folder on the C: drive. You can also use Set-Location.
2. How do I go back one folder in PowerShell?
Enter cd .. and press Enter. PowerShell moves to the parent directory, one level above your current location.
3. How do I change drives in PowerShell?
Enter the drive letter followed by a colon, such as D:, to switch to that drive’s current location. To open a specific folder, use a full path such as cd D:\Projects.
4. How do I change to a folder with spaces in its name?
Place the full path inside quotation marks. For example, enter cd “C:\Program Files” and press Enter.
5. How do I find my current directory in PowerShell?
Run Get-Location or its alias, pwd. PowerShell displays the current working directory.
Summary
Changing directories in PowerShell is easy once you learn a few essential commands. Use cd or Set-Location to open a folder, cd .. to move up one level, and Get-Location to check where you’re working.
You can also switch drives, navigate to folders containing spaces, and return to a previous location. If a command fails, double-check the path, confirm that the folder exists, and use quotation marks when needed.
Practice these commands with a few familiar folders on your Windows PC.
Once you’re comfortable navigating directories, you’ll find it much easier to run PowerShell commands, manage files, and automate everyday tasks.
