CMD Guide: Open Any File or Folder using Command

The Command Prompt or CMD is a very useful tool in Windows. Although there aren’t a lot of users that bother to try it out, it still is a favorite place of many programming geeks out there. If you’re one among them, then your dependency on a mouse is really low or none at all and all you wish to do is control your system with mere keystrokes.

CMD Guide: Open Any File or Folder using Command

CMD Guide: Open Any File or Folder  using Command

This is where the Command Prompt shines. It lets you open any file or folder on your computer with minimal cursor changes or a mouse dependency. So if you’re trying to inject your brain with more information about opening files or folder with CMD, then our CMD guide to open any file or folder using command will surely help you.

Step 1 – Open Command Prompt

There are multiple ways to open the Command Prompt on your PC. First, you can open it by simply pressing the Windows + R keyboard shortcut. Also, by pressing the Ctrl + Shift + Enter keyboard shortcut command, you can run the Command Prompt as administrator. Finally, you can click on the Windows search button, type in cmd, and open the Command Prompt from there. By right-clicking on the result, you’ll have the option to run it as administrator.

Step 2 – Opening any file or folder using CMD

How to open a folder

  1. In the Command Prompt window, enter down the following code:
    cd\folder name

    Here, simply replace the phrase folder name with the name of the folder you want to open. For example, cd\Example folder will open that particular folder in the drive
  2. After entering the code, press the enter key. This will give you a new follow up line. Continuing with it, type in start. (followed by the period) and then press the enter key. This will open the respective folder on your computer

How to open a file

In order to open a file using the Command Prompt, we have three ways. One is to move to the folder that contains the file and then open the file. The second way is to simply open the file directly by entering down its path. The last way is to command a specific application to open a file for you. Below, we’ll list the steps for both the ways of opening a file with the Command Prompt. Just read on carefully and apply the steps precisely.

Method 1 – move to the folder first and then open the file

  1. The first step is to enter down the command for the location of the folder. This is the same step as opening the folder through the Command Prompt but there’s something you should know before attempting. Open the command prompt and enter the following code for the folder that contains the file you want to open:
    cd\folder name

    Same as before, replace the phrase folder name with the actual name of the folder. You can add another slanding line(\) if there are folders within a folder. An example will be cd C:\Users\mini\Desktop
  2. Then, press the enter key. The next step is to enter the file name. After pressing the enter button, simply type in the file name along with its extension, all of them inside double quotes(“). An example is “example file.png”

Method 2 – open the file directly

  1. In order to do this, all you have to do is enter down the entire file path including the file extension. Simply enter the full path and add the file and its extension along with it, all in one single command line. An example will be “C:\Example folder\file.png”

  2. After entering down the line of code, simply press the enter key and the respective file will open.

Method 3 – commanding a specific application to open a file

  1. For this, open your Command Prompt and enter down the whole path of the application like this C:\Users\mini\”%windir%\system32\mspaint.exe” 
  2. Then, along with the above line of path, enter down the whole path of the file like  “C:\Users\mini\Desktop\travel.png”
    So together, it should read C:\Users\mini\”%windir%\system32\mspaint.exe” “C:\Users\mini\Desktop\travel.png” in a single command line as shown in the screenshot
  3. Finally, press the enter button and see the commands in action!

With that, we’ll conclude our guide on opening any file or folder with the Command Prompt. Since we have several methods of doing this, you can choose one that you feel is most suitable for you and it will get things done with a few keystrokes on your computer. That said, we hope reading the article above has equipped you with some bit of information. Please let us know by commenting down below if you have any further queries regarding the same.

Also, check out our iPhone Tips and TricksPC tips and tricks, and Android Tips and Tricks if you’ve got queries for it or want help. Thank you!

Leave a Reply

Your email address will not be published. Required fields are marked *

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