Способ 1: Указание пути
Для начала рассмотрим метод, который подразумевает не запуск консоли в папке, а переход в нее непосредственно через интерфейс консоли.
- Откройте в «Проводнике» то расположение, в котором требуется запустить «Командную строку», выделите и скопируйте указанный в верхней строке адрес. Для этого можно воспользоваться клавишами «Ctrl+C» или соответствующим пунктом контекстного меню.
Читайте также: Как открыть «Проводник» в Виндовс 10
- Любым удобным способом запустите консоль, например, воспользовавшись поиском по системе (запрос —
cmd
).Читайте также: Как вызвать поиск и открыть «Командную строку» в Windows 10
- Введите команду следующего вида и нажмите «Enter».
cd путь к папке, в которой требуется открыть консоль
(в нашем примере это
cd C:\Lumpics
)
На этом поставленная перед нами задача решена – «Командная строка» открыта в папке, дальнейшие команды будут выполняться в указанном расположении.
Обратите внимание! Если действия, которые вы планируете осуществить, требуют административных полномочий, запускать консоль нужно от имени пользователя, обладающего соответствующими правами. О том, как это сделать, рассказывается в отдельной статье на нашем сайте.
Подробнее: Как запустить «Командную строку» от имени Администратора в Виндовс 10
Способ 2: Контекстное меню и PowerShell
В предшествующих «десятке» версиях Windows открыть консоль в папке можно было через контекстное меню, но теперь в данном пункте фигурирует PowerShell. Из этой системной оснастки тоже крайне просто перейти к той, что интересует нас.
- Откройте папку, в которой требуется запустить «Командную строку», кликните правой кнопкой мышки (ПКМ) по пустому месту и выберите пункт «Открыть окно PowerShell здесь».
- Введите запрос
cmd
и нажмите «Enter». - Несмотря на то что интерфейс не изменится, необходимое вам расположение будет открыто именно в консоли, с поддержкой характерного для нее синтаксиса команд.
Читайте также: Команды для «Командной строки» в Виндовс 10
Способ 3: Меню «Проводника»
Данный метод по своей сути является альтернативой предыдущему и отличается лишь первым шагом.
- Перейдя в нужную директорию через «Проводник», вызовите меню «Файл», выберите в нем пункт «Запустить Windows PowerShell», а затем аналогичный ему в появившейся дополнительной вкладке.
- Введите команду
cmd
и воспользуйтесь клавишей «Enter» для ее выполнения. - Как и в предыдущем случае, «Командная строка» будет открыта в указанном расположении, хотя и сохранит интерфейс «PowerShell».
Наша группа в TelegramПолезные советы и помощь
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,545 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,445 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
Еще в ранних версиях Windows 10 можно было, зажав клавишу [Shift], кликать правой кнопкой по папке в проводнике и вызывать командную строку, но более поздние версии Windows 10 позволяют открывать только PowerShell. Чтобы вернуть окно команд в контекстное меню, нужно изменить реестр.
Нажмите [Win] + [R] и введите «regedit» без кавычек. Откройте путь «HKEY_CLASSES_ROOT\Directory\shell\cmd», правой кнопкой щелкните «cmd» и выберите «Разрешения». В следующем окне щелкните «Администраторы» и установите внизу в поле «Полный доступ» флажок «Разрешить». Щелкните «Применить» и затем «OK».
Если выскочило уведомление, что не удалось сохранить изменения из-за отказа в доступе, необходимо использовать немного другой путь. Снова нажмите правой кнопкой на «cmd» и выберите «Разрешения».
В открывшемся окне выберите «Дополнительно» и далее «Изменить» вверху. Введите свое точное имя пользователя в поле для ввода и нажмите «Проверить имена».
Если имя подтверждено, то Windows скорректирует ввод. Нажмите «OK» и вернитесь в окно, где можно разрешить полный доступ. Но теперь выберите строку «Пользователи» и активируйте полный доступ, нажав «Применить» и подтвердив «OK». Подсказка: точное имя пользователя вы найдете в папке «C:\Пользователи».
Вернитесь в редактор реестра. В правом поле есть параметр «HideBasedOnVelocityId». Щелкните по нему правой кнопкой, выберите «Переименовать» и добавьте в начало имени, например, дефис.
Закройте редактор реестра. Теперь в контекстном меню любой папки при зажатой клавише [Shift] снова появится строка «Открыть окно команд».
Читайте также:
- Как Windows 10 взломать реестр и удалить OneDrive из Проводника
- Как создать резервную копию реестра Windows
Фото: компании-производители
-
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.