Способ 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Полезные советы и помощь
Еще в ранних версиях 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
Фото: компании-производители
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
-
Home
-
News
- How to Open a File/Folder in Command Prompt (CMD) Windows 10
By Alisa |
Last Updated
Wonder how to open a file cmd or how to open a folder in Command Prompt on Windows 10? This tutorial provides a step-by-step guide. Also, if you can’t find some files or folders in Windows 10, or some files are unexpectedly lost in your Windows 10 computer, MiniTool free data recovery software for Windows 10/8/7 can help you easily recover lost files.
You can also open files from Command Prompt. Wonder how to open a file or folder in Command Prompt on Windows 10? Check the step-by-step guide in this tutorial.
How to Open a File CMD Windows 10 in 2 Steps
Step 1 – Open Command Prompt
You have several ways to open Command Prompt in Windows 10.
You can press Windows + R keys on the keyboard to open Windows Run dialog. Then type cmd in the Run box. If you want to run Command Prompt as Administrator, you need to press Ctrl + Shift + Enter keys at the same time.
Alternatively, you can also click Start or Search box in Windows 10, and type cmd or command prompt. Right-click the Command Prompt app in the list and choose Run as administrator.
Step 2 – Open Files from Command Prompt
Normally you have two ways to open a file using cmd. One is to move the folder that the file is in, the other is to open the files directly in Command Prompt.
Method 1. How to open a file with cmd by moving to the folder firstly
- You can use the cd command to move to the exact folder the file lies in. For instance, cd C:\Users\mini\Desktop.
- After you are in the correct folder path, you can type the name of the file with its extension, e.g. “travel.png”, and hit Enter button to open it.
Method 2. How to open a file using cmd directly
You can also choose to open files from Command Prompt on Windows 10 directly, instead of going to the folder path. You can input the full path, file name and its file extension to open the target file, e.g. “C:\Users\mini\Desktop\travel.png”.
You can also freely specify an app to open the file. You need to type the whole path of the app ahead of the path of the file, for example, “%windir%\system32\mspaint.exe” “C:\Users\mini\Desktop\travel.png”. Press Enter to open the file using CMD.
How to Open a Folder in Command Prompt Windows 10
You can also open a folder from Command Prompt with the command line below.
After you enter into Command Prompt window by following the operation above, you can open a folder in File Explorer in Command Prompt. The command line can be like this, start %windir%\explorer.exe “C:\Users\mini\Desktop”.
Tip: Need to mention that you need to enclose the path of a file or folder in double quotation marks, since some folder or files names have spaces in them.
>> Quick Video Guide:
To Recover Unexpectedly Lost Files or Folders in Windows 10
Sometimes you may suffer unexpected data loss in Windows 10 due to various reasons, e.g. system crash, Blue Screen error (e.g. Bad Pool Caller BSOD error), power outage, malware/virus infection, hard drive failure, etc. To easily recover lost data for free, you can choose the best free data recovery software to realize it.
MiniTool Power Data Recovery, a 100% clean and free data recovery software for Windows 10/8/7, enables you to easily recover mistakenly deleted files or lost files from computer local drive, external hard drive, SSD drive, USB drive (pen drive data recovery), SD card, and more.
MiniTool Power Data Recovery TrialClick to Download100%Clean & Safe
About The Author
Position: Columnist
Alisa is a professional English editor with 4-year experience. She loves writing and focuses on sharing detailed solutions and thoughts for computer problems, data recovery & backup, digital gadgets, tech news, etc. Through her articles, users can always easily get related problems solved and find what they want. In spare time, she likes basketball, badminton, tennis, cycling, running, and singing. She is very funny and energetic in life, and always brings friends lots of laughs.
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?