Are you tired of navigating through multiple folders in the command prompt just to reach your desired directory? Do you wish there were a faster and more efficient way to open PowerShell in a specific folder? I’ll walk you through several methods to quickly open PowerShell in any folder on your Windows machine.
Method 1: Open PowerShell from File Explorer
The easiest way to open PowerShell in a folder is directly from the File Explorer. Here’s how you can do it:
- Press the
Win+Ekeys simultaneously to open the File Explorer. - Navigate to the folder where you want to open PowerShell.
- Once you’re in the desired folder, click on the address bar at the top of the File Explorer window. You can also use the keyboard shortcuts
Alt+DorCtrl+Lto focus on the address bar. - Type
powershellin the address bar and pressEnter.
PowerShell will open in the current folder, ready for you to execute commands.
Pro Tip: Open PowerShell as Administrator
If you need to run PowerShell with administrative privileges, you can easily do so from the File Explorer as well:
- Follow steps 1-2 from the previous section to navigate to your desired folder.
- Hold down the
Shiftkey and right-click on an empty space within the folder. - From the context menu, select “Open PowerShell window here”.
PowerShell will now open with administrative rights in the current folder.
Check out Show Logged-In Users with PowerShell
Method 2: Use the PowerShell Context Menu
Another quick way to open PowerShell in a folder is by using the built-in context menu. Here’s how:
- Open the File Explorer and navigate to the folder where you want to open PowerShell.
- Hold down the
Shiftkey and right-click on an empty space within the folder. - From the context menu, select “Open PowerShell window here”.
PowerShell will now open in the current folder.
Method 3: Use the Windows Terminal
If you have the Windows Terminal installed, you can easily open PowerShell in a folder with just a few clicks:
- Open the File Explorer and navigate to the desired folder.
- Right-click on an empty space within the folder.
- From the context menu, select “Open in Terminal”.
The Windows Terminal will launch with PowerShell in the current folder.
Check out Set Password Never Expires for Local User Using PowerShell
Method 4: Create a Desktop Shortcut
For quick access to PowerShell in a specific folder, you can create a desktop shortcut:
- Right-click on an empty space on your desktop.
- Select “New” > “Shortcut”.
- In the “Type the location of the item” field, enter the following command, replacing
<FolderPath>with the actual path to your desired folder:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoExit -Command "Set-Location '<FolderPath>'"- Click “Next” and give the shortcut a name, then click “Finish”.
Now, whenever you double-click on the desktop shortcut, PowerShell will open in the specified folder.
Check out Set the Default Printer Using PowerShell in Windows
Method 5: Use the Run Dialog
You can also use the Run dialog to open PowerShell in a folder quickly:
- Press the
Win+Rkeys to open the Run dialog. - Type
powershellfollowed by a space and the path to your desired folder, then pressEnter. For example:
powershell C:\Users\Bijay\DocumentsPowerShell will now open in the specified folder.
Conclusion
In this tutorial, I’ve shown you five different methods to open PowerShell in a folder on your Windows machine. Whether you prefer using the File Explorer, context menu, Windows Terminal, desktop shortcut, or Run dialog, you now have the knowledge to quickly navigate to your desired directory and start working with PowerShell.
I hope this guide has helped open PowerShell from a folder using these methods. If you have any questions or suggestions, feel free to leave a comment below.
You may also like the following tutorials:
- Set the Time Zone Using PowerShell in Windows
- Update PowerShell on Windows 11
- Get Default Browser Using PowerShell
Bijay Kumar is an esteemed author and the mind behind PowerShellFAQs.com, where he shares his extensive knowledge and expertise in PowerShell, with a particular focus on SharePoint projects. Recognized for his contributions to the tech community, Bijay has been honored with the prestigious Microsoft MVP award. With over 15 years of experience in the software industry, he has a rich professional background, having worked with industry giants such as HP and TCS. His insights and guidance have made him a respected figure in the world of software development and administration. Read more.