Windows run cmd from folder

How to Open a File/Folder in Command Prompt (CMD) Windows 10 [MiniTool News]

By Alisa | Follow | Last Updated December 31, 2020

Summary :

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 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.

Windows 10 repair, recovery, reboot, reinstall, restore solutions. Learn how to create Windows 10 repair disk, recovery disk/USB drive/system image to repair Windows 10 OS issues.

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, C:\Users\mini\”%windir%\system32\mspaint.exe” “C:\Users\mini\Desktop\travel.png”.

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”.

Читайте также:  Проблемы при загрузке компьютера windows

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.

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.

Easy 3 steps to fast recover my files/data for free with best free file recovery software. 23 FAQs and solutions for how to recover my files and lost data are included.

  • Facebook
  • Twitter
  • Linkedin
  • Reddit

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.

Ways to open Command Prompt in a folder in Windows 10

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.

Open a command prompt window in any folder

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 10 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 10 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.

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.

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!

Date: April 8, 2020 Tags: CMD, Context Menu

4 Ways To Open Command Prompt Window in a Folder In Windows 10

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.

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

  1. Click Windows + R then type regedit. This will open Windows Registry editor.
  2. Registry editor window will open. After that go to HKEY_CLASSES_ROOT. Further go into Directory\shell\cmd
  3. and right click Permissions. The following window will appear.
  4. Then click on the Advanced option.
  5. After that, click on change at the top of the window
  6. Type your username in “Enter the object name to select” and then click on the check name to validate that name.
  7. 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
  8. Once you are done with it, click on HideBasedonVelocityID and rename it ShowBasedonVelocityId
  9. 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.

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:

  1. Go to the required folder.
  2. The press Shift + right click mouse button anywhere in the folder window.
  3. 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.

  1. Go to your desired folder and click on the location bar of Windows Explorer.
  2. Then type cmd and press Enter key.
  3. 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.

Читайте также:  Драйвер для ноутбука lenovo b590 windows 10

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.

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?

Hotkey to open cmd with administration rights in current folder from Explorer

In Explorer sequence Shift+F10 -> open command window here opens cmd in current directory.

Is there any way to do the same via shortcuts to launch cmd with administration rights?

5 Answers 5

Complete shortcuts are listed here Link to the answer

  1. Right-click Start & choose Command Prompt or Command Prompt (Admin) from the Quick Link menu. You can also use keyboard shortcuts for this route: Windows key + X, followed by C (non-admin) or A (admin).
  2. Type cmd in the search box, then press Enter to open the highlighted Command Prompt shortcut. To open the session as an administrator, press Alt+Shift+Enter.
  3. From File Explorer, click in the address bar to select its contents; then type cmd and press Enter. That opens a non-admin Command Prompt session in the current folder.
  4. In a File Explorer window, hold down Shift as you right-click on a folder or drive. That opens a non-admin Command Prompt session in the selected location.
  5. To open an administrative Command Prompt window in the current folder, use this hidden Windows 10 feature: Navigate to the folder you want to use, then hold Alt and type F, S, A (that keyboard shortcut is the same as switching to the File tab on the ribbon, then choose Open command prompt as administrator).
  1. Simply open cmd prompt from start as Run as Administrator,
  2. Copy the path where you want to execute using location/Address Bar
  3. Use CD space paste the address and press Enter

It will set to the desired folder path

I added the commands to the Explorer context menu in the registry for the background, folders, and files.

I know that you wanted a keyboard shortcut. I am hoping that you can use and adapt the commands and use the existing Windows shortcut system that allows you to set keyboard shortcuts.

Here is a link to an article that has the commands and a link to a ZIP with a REG file:

Adding to the Windows registry:

For the folder context-menu: (right-clicking on a folder in an explorer window)

powershell -WindowStyle Hidden «start cmd \»/k cd /d %1\» -v runAs»

For the background context-menu: (right-clicking on the background of an explorer window):

powershell -WindowStyle Hidden «start cmd \»/k cd /d %V\» -v runAs»

For the file context-menu: (right-clicking on a file in an Explorer window):

powershell -WindowStyle Hidden «start cmd \»/k cd /d %w\» -v runAs»

Here is a link to an article about the shell variables:

EDIT:

I added keyboard shortcuts using Shift+F10, Shift+Context menu key, or Shift-Right click, and then a given letter for the desired option, which you can modify in the registry. I put all of the files onto GitHub at the link below.

Оцените статью