The Command Prompt (CMD) is one of the most powerful tools in Windows 11. It allows you to perform system tasks, automate commands, and navigate through files and folders using simple text commands.
If you often work with the Command Prompt, knowing how to open files and folders directly from CMD can save time and make navigation much faster.
In this guide, we’ll explain all the practical ways to open files, folders, and even apps from the Command Prompt on Windows 11.
1. Open Command Prompt
Before you can open anything, you need to launch the Command Prompt.
Option 1: Open CMD Normally
- Press Windows + R to open the Run dialog box.
- Type
cmdand press Enter.
Option 2: Open CMD as Administrator
- Press Windows + S and type cmd.
- Right-click Command Prompt and select Run as administrator.
Once CMD is open, you can start navigating and opening files or folders.
2. Navigate to a Folder in Command Prompt
You can move between directories using the cd (change directory) command.
Example 1: Open a Specific Folder
To go to the Documents folder, type:
cd C:\Users\<YourUserName>\Documents
Press Enter. CMD will now be focused on the Documents directory.
Example 2: Go Back to a Previous Folder
To move up one directory level, use:
cd ..
Example 3: Switch to a Different Drive
If you want to switch from the C: drive to the D: drive, just type:
D:
and press Enter.
3. Open a Folder in File Explorer from CMD
If you’re inside a directory in CMD and want to open that same folder in File Explorer, use this command:
start .
The dot (.) represents the current directory. This will instantly launch the folder in File Explorer.
You can also open any other folder by specifying its path:
start C:\Users\<YourUserName>\Downloads
This will open the Downloads folder directly.
4. Open a File from CMD
You can open any file (such as a text document, PDF, or image) from CMD using the start command followed by the file name.
If you’re in the folder that contains your file, type:
start example.txt
This will open the file in its default associated program (in this case, Notepad).
If the file is located elsewhere, include its full path:
start C:\Users\<YourUserName>\Desktop\example.pdf
CMD will automatically open the file with its default application.
5. Open Applications from CMD
The Command Prompt can also open applications and programs directly.
To open Notepad, type:
start notepad
To open Microsoft Word, use:
start winword
To open File Explorer, type:
start explorer
You can use this trick for almost any app that’s registered in your system’s PATH environment variable.
6. Open Hidden or System Folders
CMD lets you access hidden folders that may not appear in File Explorer by default.
For example, to open the AppData folder:
cd %appdata%
Then, to open it in File Explorer, type:
start .
You’ll now be inside the AppData directory, even if it’s hidden.
7. Open Files Using Associated Programs
By default, Windows knows which program should open which file type. The start command uses that association.
For instance:
start photo.jpgwill open your default photo viewer.start song.mp3will open your default music player.start report.docxwill open Microsoft Word.
If you want to open a file with a specific program, include the app’s path followed by the file name.
"C:\Program Files\Notepad++\notepad++.exe" "C:\Users\<YourUserName>\Desktop\notes.txt"
This command opens the notes.txt file in Notepad++.
8. Open Folder or File Paths with Spaces
If the file or folder path contains spaces, you must enclose the path in double quotes.
start "C:\Users\<YourUserName>\My Documents\report.docx"
Without quotes, CMD would interpret the path as multiple arguments and return an error.
9. List All Files and Folders Before Opening
If you’re unsure what’s in the current directory, you can view all contents before opening something.
Type:
dir
This lists all files and folders in the directory. Then you can open any of them using the start command.
10. Use Environment Variables to Open Common Folders
Windows has built-in environment variables that make it easier to open frequently used folders in CMD.
Here are some examples:
- Open Documents:
start %userprofile%\Documents - Open Desktop:
start %userprofile%\Desktop - Open Downloads:
start %userprofile%\Downloads - Open System32 folder:
start %windir%\System32
These shortcuts save you from typing long directory paths manually.
11. Open Websites from CMD
You can even open a website directly from Command Prompt using the start command:
start https://codinglap.com
This will open your default web browser and load the site instantly.
Wrapping Up
Learning how to open files and folders in CMD gives you faster control over your Windows 11 system and improves your workflow. You can use simple commands like cd to navigate directories, start to open files or apps, and environment variables to access common folders quickly.
Whether you’re troubleshooting, scripting, or just exploring Windows deeper, mastering these basic CMD operations will help you get things done efficiently — right from the command line.