The basic command to open a file
To open a file in Command Prompt, type the full path to the file after a command that tells Windows what to do with it. The simplest approach is to type the filename directly if you are already in the folder where it lives, or type the full path from anywhere. Command Prompt does not open files the way File Explorer does — it hands them to the program that knows how to read them.
The most common method is to type start followed by the filename or path. For example, start document.txt opens a text file in Notepad, and start C:\Users\YourName\Documents\report.pdf opens a PDF in your default PDF reader. Windows automatically chooses the right program based on the file type.
Key Takeaways
- The start command opens a file in its default program without keeping Command Prompt waiting for it to close.
- Type the full path if the file is not in your current folder, or use cd to navigate to the folder first.
- You can specify a particular program to open the file with instead of using the default — for example, start notepad.exe filename.docx.
- Use quotes around paths that contain spaces, like start "C:\Program Files\My Folder\file.txt".
Finding your current location and navigating to the file
Before you open a file, you need to know where you are in the folder structure. Type cd (which stands for "change directory") to see your current location, or type dir to list all files and folders in the current directory. If the file you want is in a different folder, use cd followed by the folder path to move there.
For example, if you are in C:\Users\YourName and want to open a file in your Documents folder, type cd Documents to move into that folder. Then type dir to see the files there. Once you see the filename you want, you can open it with the start command.
If you need to go up one level in the folder structure, type cd .. (two periods). To jump directly to a specific path from anywhere, type the full path after cd, like cd C:\Users\YourName\Downloads.
Using the full path when the file is elsewhere
You do not have to navigate to a file's folder first. You can open it from anywhere by typing the complete path. For instance, start C:\Users\YourName\Documents\spreadsheet.xlsx opens that spreadsheet no matter which folder you are currently in.
If the path contains spaces — which is common in Windows folder names like "Program Files" or "My Documents" — wrap the entire path in quotation marks. Type start "C:\Program Files\Application\file.txt" so Command Prompt reads the whole thing as one path instead of stopping at the first space.
Opening a file with a specific program
By default, Windows opens files with whatever program you have set as the default for that file type. If you want to open a file with a different program, specify the program name after start. For example, start notepad.exe myfile.docx opens a Word document in Notepad instead of Microsoft Word.
You can also use the full path to the program if it is not in a standard location. Type start "C:\Program Files\VLC\vlc.exe" "C:\Users\YourName\video.mp4" to open a video file in VLC media player. Again, use quotes around any path that contains spaces.
Viewing file contents without opening a separate window
If you just want to read the contents of a text file without opening it in another program, use the type command. Type type filename.txt and the file's contents will display directly in Command Prompt. This works for plain text files, configuration files, and log files.
For larger files, you can use more filename.txt to display the contents one screen at a time. Press the spacebar to see the next page, or press Q to quit and return to the Command Prompt.
Troubleshooting when a file will not open
If you type a command and nothing happens, the most common reason is that Command Prompt cannot find the file. Check that the filename and path are spelled correctly, including the file extension. Type dir to list the files in your current folder and verify the exact name.
If you get an error message saying the file type is not recognized, Windows does not have a default program for that file type. Use the start command with a specific program name, like start notepad.exe unknownfile.xyz, to open it with a program you choose.
If the path contains special characters or unusual spacing, try wrapping it in quotes. If Command Prompt still cannot find the file, copy the full path from File Explorer: right-click the file, select Properties, and copy the location shown there.
Frequently Asked Questions
What is the difference between start and just typing the filename?
Typing just the filename tries to run it as a program. Using start tells Windows to open the file with its default program and then return control to Command Prompt. For text files, images, and documents, always use start.
Can I open multiple files at once?
Yes. Type start file1.txt and then start file2.txt on separate lines, or type start file1.txt & start file2.txt on one line. Each file opens in its own window.
How do I open a file if I do not know the full path?
Use File Explorer to find the file, right-click it, and select Properties. Copy the full path shown there and paste it into Command Prompt after the start command. Alternatively, type dir /s filename.txt to search for the file in the current folder and all subfolders.
What if the filename has spaces in it?
Wrap the filename in quotes: start "my document.txt". This tells Command Prompt to treat the whole thing as one filename instead of two separate words.
Can I open a file that is on a network drive or USB stick?
Yes, if the drive is connected and assigned a letter. Type the drive letter followed by a colon, like start E:\folder\file.txt if your USB stick is drive E. Use net use to map a network drive if you need to access files on another computer.