How to Open Files and Folders in CMD on Windows
Opening files and folders using the Command Prompt (CMD) in Windows might seem complex at first, but it’s quite straightforward once you learn a few basic commands. Here’s a step-by-step guide on how to accomplish this task.
Step 1: Open Command Prompt
– Press the Windows key or click on the start menu.
– Type “CMD” or “Command Prompt” in the search bar.
– Click on “Command Prompt” from the search results or press Enter.
Step 2: Change Directory to the Desired Folder
Before you can open a file, you need to navigate to the directory that contains it. You’ll use the `cd` command, which stands for “change directory.”
– To display the current directory you’re in, type `cd` and press Enter.
– To go to a specific folder, type `cd path\to\your\folder` and press Enter. Replace “`path\to\your\folder`” with the actual path.
Here’s an example: If you want to go to the Documents folder located in your user directory, type:
“`
cd C:\Users\YourUsername\Documents
“`
Replace “`YourUsername`” with your actual username.
Step 3: List Files in a Directory
To see a list of files in your current directory:
– Simply type `dir` and press Enter.
This command will show all files and folders within your current directory.
Step 4: Open a File
To open a file using CMD:
– Type its name with its extension after you’re in its directory. For example, if there’s a text file named “example.txt,” type:
“`
example.txt
“`
and press Enter. The file will open in its default application.
Note: If the file doesn’t open, or it’s not associated with an application, then specify the program you want to open it with. For instance, for a text file:
“`
notepad example.txt
“`
Step 5: Open a Folder
If you want to open a folder in File Explorer through CMD:
– Type `start foldername` and press Enter. Replace “`foldername`” with the name of your folder.
For instance:
“`
start .
“`
This command opens the current directory in File Explorer.
Here’s another example:
“`
start Pictures
“`
This command would open the Pictures folder if it’s within your current directory.
Now you know how to navigate Windows directories and open files and folders through Command Prompt! These basic commands are powerful tools for managing files via a command-line interface on Windows systems.