When you open the command prompt by going to Run –> cmd, you will notice that by default, it opens in the user profile directory path. Sometimes, the user needs to open the command windows with the currently opened folder path. This article explains the exact scenario.
Command Prompt is the command-line which enables users to execute different programs and commands. Microsoft is slowly removing command prompt support from all its major Windows platforms. PowerShell is the alternative to Command Prompt which supports almost all the commands of DOS and much more. Some users still insist on using Command Prompt instead of PowerShell.
If the program you want to run in Command Prompt is not listed in the PATH variable, the Command Prompt will give you an error that it could not find the executable file. For this, we need to manually go to the folder where that particular program is located. One way of doing this is to type in the complete path of the file. Another way is to directly open the command prompt windows inside the folder. The second approach is more visual and easy to implement.
Pro Tip: If you are using Windows 10, just open the folder and go to File menu –> Open Windows PowerShell. You also have the option to open Windows PowerShell as Administrator.
Table of Contents
In this article, we will discuss different techniques by which we can open command windows in a folder, the most popular being “Open Command Windows Here” context menu item. Let’s start.
Add Open Command Window Here to the context menu using Registry Editor
- Click Windows + R then type regedit. This will open Windows Registry editor.
- Registry editor window will open. After that go to HKEY_CLASSES_ROOT. Further go into Directory\shell\cmd
- and right click Permissions. The following window will appear.
- Then click on the Advanced option.
- After that, click on change at the top of the window
- Type your username in “Enter the object name to select” and then click on the check name to validate that name.
- Press Apply and then OK. When you are done with those Administrative modes in Group or user names of permissions for cmd window and tick Allow on Full control. Click Apply and then OK
- Once you are done with it, click on HideBasedonVelocityID and rename it ShowBasedonVelocityId
- Now when you click the Shift key and right click you will see the option “Open Command Window here“
This will permanently add “Open Command Window here” to the Windows Context menu. After editing the Registry, you will be able to open the command prompt by right clicking inside any folder and selecting “Open Command Window Here”.
Add Open Command Window Here using the REG file
This is basically the same method listed above. For your ease, we have created a REG file for all the actions mentioned above. You just have to download and run the REG file. It will automatically add the desired values inside the Windows Registry.
Add Open Command Window Here to Context Menu.reg (304 bytes, 20,542 hits)
If the value does not come after running this file, please try restarting Windows Explorer or the computer.
Open Command Prompt In A Folder Using Keyboard Shortcut?
If you are in a hurry then this is the easiest method of opening Command Prompt inside the folder. Just follow the steps below:
- Go to the required folder.
- The press Shift + right click mouse button anywhere in the folder window.
- Select the “Open command window here” option from the context menu.
Using CMD command in File Explorer to open Command Prompt Window
You can open a command prompt in any of your desired folder by using the file explorer location bar.
- Go to your desired folder and click on the location bar of Windows Explorer.
- Then type cmd and press Enter key.
- The command prompt will be opened in the folder.
One drawback of this technique is that it will open the command prompt in the regular user privilege mode and not in the administrative mode. To open it in administrative mode:
Select Windows + R and type cmd.
Click Ctrl+Shift+Enter instead of just hitting enter to open the Command Prompt in administrative mode.
You can also open PowerShell window using the same technique. Just go to the folder and then type powershell in the File Explorer address bar. This will open PowerShell in the same folder location or path.
Add “Open Command Window Here” with Administrative privileges in the context menu
In order to “open Command Window here ” with administrative privileges you can download the following file.
Open Command Window Here (Administrator) to context menu.reg (215 bytes, 12,441 hits)
This will add a context menu option for the admin command prompt.
How to get back Command Prompt in Win+X menu?
In order to change the Windows Powershell options with Command Prompt go to Settings –> Personalization –> Taskbar. After that turn off the option of “Replace Command Prompt with Windows Powershell Option in the menu when i right click the start button or press Windows key +X”.
The Command Prompt still remains an important part of Windows Operating System and using the methods discussed above, you will be able to make productive use of your time by using shortcuts. What is your favorite method of running command prompt without typing in the folder paths?
Shift+Right-click in the folder to see the option to open CMD
Published on July 29, 2024
What to Know
- From the folder you want to open in Command Prompt, hold the Shift key, then right-click an empty area.
- From there, select Open in Terminal (W11) or Open PowerShell window here.
- Alternatively, change the folder path (at the top of File Explorer) to cmd. Press Enter to open CMD in that folder.
This article teaches you how to open Command Prompt in a way that lets you start working from a specific folder immediately. Here’s how to start CMD from a folder in Windows 11 (it’s very similar in older versions).
How to Open CMD in a Folder
It’s easy to start Command Prompt the normal way, but if you know which folder you want to run commands in, you’ll save yourself a step or two if you open Command Prompt in the folder from the start. Below are two methods.
Change the Folder Path
Follow these steps for the fastest way to open Command Prompt in a folder. All you have to do is type cmd in the right place.
-
Open File Explorer to the folder you plan to work in. For example, if it’s your Downloads folder, you’d navigate here:
C:\Users\[your username]\Downloads
-
Erase the folder path at the top of the window. Pressing Alt+d is a quick way to highlight the whole path.
-
Replace the path with cmd.
-
Press Enter. This will open Command Prompt directly to that folder.
Use a Keyboard Shortcut
Here’s how it works with a simple keyboard+mouse shortcut:
-
Go to the folder you want to access from Command Prompt.
-
While holding the Shift key, right-click once in an empty area of the folder (don’t select any files or subfolders).
-
Select Open in Terminal if you’re on Windows 11. Older versions of Windows have a similar option called Open PowerShell window here.
Terminal is the command line tool used in Windows 11. Follow that link to learn how to access Command Prompt and other tools from Terminal.
The Command for Changing Folders in Command Prompt
The steps listed above are simple ways to open CMD to a certain folder without dealing with commands. But, did you know there is a command meant for this very purpose?
It’s called the change directory command and it’s invoked by typing cd. It’s how you open a different folder from inside Command Prompt, which is useful if you don’t want to start a brand-new instance of Command Prompt just to change the folder you’re in.
How to Clear the Windows Command Prompt Screen
FAQ
-
It’s a command-line interpreter program that’s available on all Windows PCs. It’s often used to perform more advanced administrative functions or to troubleshoot an issue. The commands you can use depend on which version of Windows you own.
-
Type cls and press Enter. This clears all the previous commands you entered.
-
Yes, but you need to enable it first in some instances. Open Command Prompt, right-click on the top bar, and select Properties. Under Edit Options, select the checkbox next to Use Ctrl+Shift+C/V as Copy/Paste.
-
Thanks for letting us know!
Get the Latest Tech News Delivered Every Day
Subscribe
Download Windows Speedup Tool to fix errors and make PC run faster
The Command Prompt is a feature of Windows that lets you execute MS-DOS and other computer commands and perform tasks on your computer without using the Windows graphical interface. There are various ways how you can launch Command Prompt windows.
In this post, we will see two very simple ways to open a command prompt window in any folder or on the desktop, without having to navigate the menu. The first is using the context menu.
1] Hold down the Shift key and use the context menu
UPDATE: Windows has now replaced Open command window here with Open PowerShell window here. But with a registry tweak, you can restore Open command window here item to Windows folder context menu.
To open a command prompt window in any folder, simply hold down the Shift key and right-click on the desktop. In the context menu, you will see the option to Open command window here. Clicking on it will open a CMD window.
You can also do the same inside any folder. The prompt takes the path of the folder from where it is opened.
In Windows 11 you have to press the Shift key, then right-click inside the folder and then, keeping the Shift key pressed, click on More options.
You will see the extra entries there.
2] Type CMD in the address bar
There is another trick to do the same thing. navigate to the folder and then simply type CMD in the address bar and hit Enter to open the command prompt window there.
You will see the CMD taking the path of this folder.
Related read: How to change Directory in Command Prompt.
Speaking of the command prompt, there are several Command Prompt tricks you may not know, including how to open an elevated command prompt using a CMD. Check them out!
Anand Khanse is the Admin of TheWindowsClub.com, a 10-year Microsoft MVP (2006-16) & a Windows Insider MVP (2016-2022). Please read the entire post & the comments first, create a System Restore Point before making any changes to your system & be careful about any 3rd-party offers while installing freeware.
-
Home
-
Partition Manager
- How to Open Command Prompt in a Folder? 2 Techniques
By Vicky |
Last Updated
Opening Command Prompt in a folder is quite helpful especially when a program you want to run in Command Prompt is not listed in PATH variable. But how to open Command Prompt in a folder? This post shows you 2 techniques. Scroll down to see what they are.
Command Prompt is a useful Windows toolkit. On Command Prompt, you can scan system files for corruption, find your Wi-Fi password, manage disks and partitions (MiniTool Partition Wizard is another great utility for managing disks and partitions), etc. This post aims to show you how to open the useful toolkit in a folder.
Open CMD in Folder by Clicking “Open Command Window Here”
The most popular way to open CMD in a folder is by clicking the Open command window here option. In previous days, you can get the option in the context menu by holding down the Shift key and right-clicking the desktop.
However, nowadays you might find that the option has been switched to “Open PowerShell here” on Windows 10. The reason is that Microsoft continues to fade out Command Prompt in favor of PowerShell.
Do not worry! You can retrieve the Open command window here option by using registry Editor. Here is the tutorial on how to retrieve the Open command prompt here option.
Step 1: Open Registry Editor on Windows 10.
- Press Windows + R key to call out the Run
- Input regedit on the Run window and then click the OK
Step 2: On the Registry Editor window, navigate to the path: HKEY_CLASSES_ROOT > Directory > shell.
Step 3: You will see the cmd key. Right-click it and choose Permissions.
Step 4: Click the Advanced button on the Permissions for cmd window.
Step 5: Click the Change link on the Advanced Security Settings for cmd window.
Step 6: On the new window, input your account name in the box under Enter the object name to select. Then, click the Check Name button to validate that name. Finally, click the OK button.
Step 7: On the Advanced Security Setting for cmd window, tick the Replace owner on subsontainers and objects option. Then, click Apply > OK.
Step 8: On the Permissions for cmd window, choose the Administrators group. Then, tick the Allow box following the Full Control option under Permissions for Administrator. Finally, do not forget to click Apply > OK to save the changes.
Step 9: Inside the cmd key, find the HideBaseOnVelocityId DWORD and then right-click it to select Rename.
Step 10: Rename the DWORD as ShowBasedonVelocityId and press Enter.
After the ten steps, you should have successfully retrieved the Open command window here option to the Windows 10’s context menu. So, you can hold down the Shift key and right-click the desktop and then click the retrieved option to open CMD in folder.
10 Command Prompt Tricks that Every Windows User Should Know
Open CMD in Folder by Typing cmd in the File Explorer Location Bar
Alternatively, you can also open CMD in folder by typing cmd in the File Explorer location bar.
Step 1: Open File Explorer and go to the folder you desired.
Step 2: Click on the location bar of File Explorer. Then, type cmd and hit the Enter key.
Command Prompt will be opened in your desired folder.
If You want to know how to open PowerShell in a folder, please read: How to Open PowerShell in a Folder on Windows 10.
About The Author
Position: Columnist
Vicky is a website editor who has been writing tech articles since she was graduated from university. Most of her articles talk about Windows PC and hard disk issues. Some of her articles also touch on YouTube usage and issues.
During her spare time, she likes to spend time reading, watching videos, and sitting on her Yoga mat to relax.
To quickly open the Command Prompt in a specific folder, navigate to the desired directory in File Explorer, then type `cmd` in the address bar and press Enter.
cmd
Understanding CMD Prompt
What is CMD Prompt?
The Command Prompt (CMD) is a command line interpreter application in Windows. It allows users to execute commands to perform various tasks, such as managing files, configuring system settings, and running batch scripts. CMD offers a text-based interface, which, although less intuitive than graphical user interfaces, can provide powerful capabilities for users who are knowledgeable about command syntax.
Why Open CMD in a Specific Folder?
Opening Command Prompt directly in a specific folder has several advantages. It encourages efficiency and reduces the time spent navigating through directories. When you open CMD in a folder, you can quickly run commands relevant to the files in that folder, such as executing scripts or batch files. This method can dramatically improve productivity, especially for developers, system administrators, or anyone who frequently interacts with the command line.
Open Cmd From PowerShell: A Quick Guide
Using Windows Explorer Context Menu
Open CMD in Directory via Right-Click
One of the easiest methods to open CMD in a folder is through the Windows Explorer context menu.
- Navigate to the desired folder where you want to open the command prompt.
- Right-click on an empty space within that folder.
- From the context menu, select “Open command window here” or “Open PowerShell window here,” depending on your version of Windows.
For example, if you are in the folder `C:\Users\YourUsername\Documents`, right-clicking will provide the option to open the CMD, allowing you to immediately begin executing commands relevant to that specific directory.
Using the Address Bar in Windows Explorer
Opening CMD from the Address Bar
You can also quickly open the Command Prompt by using the address bar in Windows Explorer:
- Click on the address bar of the opened folder.
- Type `cmd` and press Enter.
By doing this, you will open a CMD window at the current directory path. For instance:
C:\Users\YourUsername\Documents > cmd
Using Keyboard Shortcuts
Quick Access via Keyboard Shortcuts
Keyboard shortcuts can significantly speed up your workflow. Here’s how to do it:
- Navigate to the desired folder using Windows Explorer.
- Hold down the Shift key and right-click on an empty area of the folder.
- Select “Open command window here” from the context menu.
This method works especially well when you want quick access to the command line without navigating through multiple menus.
Creating a Shortcut to Open CMD in Folder
Custom Shortcut Creation
If you frequently need to open CMD in a specific folder, consider creating a dedicated shortcut:
- Right-click on an empty space on your Desktop.
- Select New > Shortcut.
- In the location field, type:
C:\Windows\System32\cmd.exe
- Click Next, give your shortcut a name like «CMD in My Folder,» and click Finish.
- Right-click the shortcut, select Properties, and set the Start in field to your specific folder path (e.g., `C:\Your\Desired\Folder`).
This will allow you to open the Command Prompt in that folder each time you use the shortcut.
Using the Run Dialog
Open CMD Prompt via Run Dialog
Another method to open CMD in a specific directory is through the Run dialog:
- Press Windows + R to open the Run dialog.
- Type `cmd` and press Enter.
- Once the Command Prompt opens, type the following command to change to your desired folder:
cd C:\Your\Folder\Path
Pressing Enter will navigate the command line interface to the specified folder.
Opening CMD Prompt from Task Manager
Alternative Method: Using Task Manager
If you prefer using the Task Manager, it is another efficient way to open CMD:
- Press Ctrl + Shift + Esc to open Task Manager.
- Navigate to the File menu at the top left.
- Select Run new task.
- Type `cmd` and check the box for “Create this task with administrative privileges.”
This method is particularly useful if you want to run CMD as an administrator in the context of a specific folder.
Open Cmd From File Explorer: A Quick Guide
Conclusion
In summary, there are multiple methods to open CMD Prompt in a folder, each offering unique advantages based on your workflow preferences. Whether you choose to use context menus, navigation through the address bar, keyboard shortcuts, or even Task Manager, the key takeaway is the efficiency gained by opening the command line directly in your desired directory. This enables faster command execution and simplifies tasks like scripting or file management.
As you become more familiar with using CMD, consider exploring additional commands and functionalities that can enhance your productivity. Don’t hesitate to share your experiences or tips for using CMD in the comments below!