• English
  • Italiano
  • Français
  • Deutsch
  • Español

How to open files and folders from the Windows command prompt

The Windows Command Prompt is a very useful tool that allows users to interact with the operating system by typing commands. Many users, however, are not aware that it is possible to use the command prompt to open files and folders. In this article, we will show you how to open files and folders from the Windows command prompt, so you can save time and improve your productivity.

In particular, we will see:

  • How to navigate between folders using the command prompt;
  • How to open a file from the command prompt;
  • How to open a folder from the command prompt.

Accessing the Command Prompt

To access the Windows Command Prompt, follow these steps:

  1. Open the Start menu by clicking on the Start button in the taskbar or by pressing the Windows key on your keyboard.
  2. Type "cmd" in the search bar and press Enter. A Command Prompt window will open.

Alternatively, you can also access the Command Prompt using the Run window:

  1. Press the Windows + R keys simultaneously on your keyboard to open the Run window.
  2. Type "cmd" in the text field and press Enter. A Command Prompt window will open.

Example:

Suppose you want to access the folder C:\Programs\GlobalHowTo from the command prompt. Follow these steps:

  1. Open the Command Prompt as described above.
  2. Type "cd C:\Programs\GlobalHowTo" and press Enter. This command will take you to the GlobalHowTo directory.

Now you are ready to perform any operation within the GlobalHowTo folder from the command prompt.

Basic Commands to Open Files and Folders

The Windows command prompt offers a wide range of useful commands for managing files and folders on your computer. Here are some of the basic commands you can use to open files and folders:

1. "cd" Command

The "cd" (change directory) command allows you to move between folders on your computer. For example, if you want to open the "Documents" folder, type the following command:

cd Documents

This will automatically move the command prompt to the "Documents" folder.

2. "dir" Command

The "dir" (directory) command allows you to view a list of files and folders in the current location. Type the following command to display a list of files and folders in the current folder:

dir

3. "start" Command

The "start" command allows you to open a file or folder with the default application of the operating system. For example, if you want to open the file "document.txt", type the following command:

start document.txt

In this way, the file will be opened with the default application of the operating system.

4. Command "explorer"

The "explorer" command allows you to open a folder using Windows File Explorer. For example, if you want to open the "Documents" folder, type the following command:

explorer Documents

This will open the folder in Windows File Explorer.

5. Command "notepad"

The "notepad" command allows you to open a text file using Windows Notepad. For example, if you want to open the "document.txt" file with Notepad, type the following command:

notepad document.txt

This will open the file with Windows Notepad.

  • Remember that file and folder names must be typed correctly, otherwise the command prompt will not be able to locate the desired file or folder.
  • You can use your keyboard to automatically complete file and folder names. For example, if you want to access the "Documents" folder, you can type "cd Doc" and press Tab to automatically complete the folder name.

Open files with a specific application

If you want to open a file with a specific application, you can use the "start" command followed by the file path and application name.

For example, if you want to open a text file with Notepad, type:

  • start notepad C:\path\to\file\file_name.txt

This will open the text file with the Notepad application.

You can use the same command to open other types of files with their respective applications. For example, if you want to open a photo with Paint, type:

  • start mspaint C:\path\to\file\file_name.jpg

This will open the photo with the Paint application.

Remember to specify the correct full file path and application name. Otherwise, you may receive an error message.

Open a folder in File Explorer

The Windows command prompt can also be used to open a folder in File Explorer. Here's how:

  1. Open the Windows command prompt.
  2. Type "explorer" followed by the folder path you want to open. For example, if you want to open the "Documents" folder in your personal directory, type "explorer C:\Users\Username\Documents".
  3. Press Enter and the folder will be opened in File Explorer.

Alternatively, you can simply type "explorer ." (period) to open the current folder.

Remember that the folder path must be typed correctly and without typos. Otherwise, the command will not work.

This is a useful solution when you need to navigate between different folders or if you need to quickly access a specific folder without having to manually search for it in File Explorer.

Conclusion

Knowing how to use the Windows command prompt may seem complicated, but in reality there are many operations that can be performed more quickly and efficiently than using the mouse and graphical windows. Learning to use the command prompt can therefore be very useful for improving productivity and saving time.

With the information provided in this article, you are ready to start using the Windows command prompt. Experiment with various commands and discover how they can simplify your life!

Ruggero Lecce - Consulente senior di personal branding in Italia

Michael Anderson - Software Engineer

My name is Michael Anderson, and I work as a computer engineer in Midland, Texas.

My passion is sharing my knowledge in various areas, and my purpose is to make education accessible to everyone. I believe it is essential to explain complex concepts in a simple and interesting way.

With GlobalHowTo, I aim to motivate and enrich the minds of those who want to learn.