Open folder from cmd windows

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

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.

Читайте также:  Anydesk mac os old version

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

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.

How to open files and folders from the Command Prompt on Windows 10

Jan 8, 2019
Comment

Читайте также:  Как синхронизировать windows phone с компьютером windows 10

The Command Prompt can do a lot things the Windows 10 UI doesn’t give you simple, quick access to. It can also do some basic stuff like open files and folders. The commands you need for it are pretty simple. Here’s how you can open files and folders from the Command Prompt.

Open files from Command Prompt

The only real trick to opening a file from the Command Prompt is moving to the correct folder that the file is in. You can do that, or you can give the full path to the file you want to open.

Move to folder

If you’re going to move to the folder that the file is in, you need to use the cd command.

Syntax

Example

Once you’re in the correct folder, enter the name of the file you want to open with its extension and tap enter.

Open file directly

To open the file directly, instead of moving to the folder, you need to specify the path with the name of the file you want to open, with the file extension.

Syntax

Example

By default, Command Prompt will open the file in the default app that is set for it however, if you want, you can specify a different app to open the file.

Syntax

Example

Open folder from Command Prompt

To open a folder in File Explorer from Command Prompt, you need to run the following command.

Syntax

Example

Since we’re just opening files and folders, you don’t need to open Command Prompt with admin rights. The commands will work regardless what privileges Command Prompt is running with.

One thing you ought to know about providing the path to a file or folder is that you need to enclose it in double-quotes. This is normal since most folder and file names have a space in them. If you neglect to use the double-quotes, the command won’t run. If your file name and folder path don’t have any spaces in them, feel free to run the commands without the double-quotes.

Close File

You can also use Command Prompt to close a file. The command is;

Syntax

Example

Of course, if an app is able to run multiple instances, like IrfanView or Microsoft Word, the command will close all the files that are open. You might lose unsaved progress so be careful with this one.

Leave a Reply Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Way to open a folder from Windows Explorer in cmd.exe under Windows 10 with one shortcut?

I’m looking for a shortcut kind of way in Windows 10 to open cmd.exe with a directory/folder from the Windows Explorer, so that I have this specific folder as actual working directory in the command prompt.

I know the trick with holding Shift and Right-Click on the relative folder in Explorer, where you are getting an extra menu option for open it in cmd.exe, as explained here:

But unfortunately that does not work in Windows 10, it only works for Windows 7 and Windows 8. In Windows 10 you only have the option to open it in the PowerShell, but not in the command prompt / cmd.exe.

  • How do I open a folder from Windows Explorer in cmd.exe without doing too much typing?

5 Answers 5

It does work for Windows 10. There are already many duplicate questions:

Basically just take ownership of the HKEY_CLASSES_ROOT\Directory\shell\cmd key and rename the DWORD HideBasedOnVelocityId to ShowBasedOnVelocityId . For more details read

Читайте также:  Install windows from hard drive

Alternatively just use Andrew Richards’ Enhancing the “Open Command Prompt here” Context Menu experience tweak and have the option to run cmd/powershell/bash. both as normal and elevated rights

Just import the below *.reg file (or copy from the MSDN blog above)

Press Alt + D to go to the address bar*, or click in it and make sure everything is selected (it should be by default). Alternatively, user phuclv informs us that Ctrl + L also selects the address bar.

Type cmd and press Enter.

You can do the same to get a PowerShell window, just type powershell instead of cmd .

You may use the free key-remapping product AutoHotkey.

Here is a script that will start the Command Prompt on the current folder in Explorer when F12 is clicked.

After installing AutoHotKey, put the above text in a .ahk file and double-click it to test. You may stop the script by right-click on the green H icon in the traybar and choosing Exit. To have it run on login, place it in the Startup group at
C:\Users\USER-NAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup .

For choosing another hotkey than F12 , see AutoHotkey List of Keys.

Adding ‘Open command window here’ Option to the Windows 10 Context Menu of a Folder

Step One: Press Windows key and + R from the keyboard to open the Run command. Type regedit and then hit enter from the keyboard to open the registry.

Step Two: Go to the following path:

Right-click the cmd key. Scroll to Permissions and then click it.

Step Three: Click Advanced.

Step Four: Click the Change link.

Step Five: Type your user account name and click ‘Check Names’ to verify it. Click OK when you are done.

Step Six: Check ‘Replace owner on subcontainers and objects’. Click Apply and then OK.

Step Seven: In ‘Permissions for cmd’ window, select the Administrator account. Check Allow for full control option. Click Apply and then OK.

Step Eight: Inside the cmd key (right window), right click HideBasedOnVelocityId and then click Rename.

Step Nine: Rename the DWORD from HideBasedOnVelocityId to ShowBasedOnVelocityId, then hit Enter from the keyboard.

You are done. When you press shift from the keyboard and then right-click on any folder, you will have the ‘Open command window here’ option on the Windows 10 Context Menu.

Adding ‘Open command window here’ Option to the Context Menu of Background

Here are the few steps you need to take:

Step One: Press Windows key + R simultaneously to open the Run command. Type regedit and hit enter from the keyboard to open the registry.

Step Two: Go to the following path:

Step Three: Right-click the cmd key and then click Permissions.

Step Four: Click Advanced.

Step Five: Click the change link on top of the window in front of owner option.

Step Six: Type your user account name and click ‘Check Names’ to verify it. Click OK when you are done.

Step Seven: Check ‘Replace owner on subcontainers and objects’ option. Click Apply and then OK.

Step Eight: In permissions window, choose the administrator user. Check Allow for Full Control option, click Apply and then OK.

Step Nine: Inside the cmd key (right window), right-click the HideBasedOnVelocityId DWORD and then click Rename.

Step Ten: Change the DWORD name from HideBasedOnVelocityId to ShowBasedOnVelocityId and press Enter from the keyboard.

That’s all. When you press shift and right-click anywhere on your windows background, you will have an option of ‘Open command window here’ as shown in the following screenshot from Windows 10.

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