How To Open File With Cmd

3 min read

Learning how to open file with cmd is a practical Windows skill that saves time, especially when you need to launch a document, run a program, or troubleshoot a path without clicking through folders. Command Prompt may look plain, but it can open almost any file by handing it to Windows or to a specific application. The key is understanding paths, quotation marks, and the start command. Once you grasp those basics, you can open files from CMD quickly and confidently, even when the file sits deep inside a directory or has spaces in its name.

Understanding What “Opening a File” Means in CMD

Command Prompt is not a file viewer in the traditional sense. So naturally, for example, a . So txt file may open in Notepad, a . When you tell CMD to open a file, you are usually asking Windows to launch the file with its **default associated program**. pdf file may open in your PDF reader, and a .docx file may open in Microsoft Word or another word processor Worth keeping that in mind. Took long enough..

Not the most exciting part, but easily the most useful.

CMD can also open a file in a specific program by naming that program first. It can run executable files directly, and it can open folders in File Explorer. The command you choose depends on what you want to happen That's the whole idea..

The most useful command for this task is:

start "" "C:\Path\To\Your\File.ext"

The empty quotation marks are important. Worth adding: in the start command, the first quoted item is treated as the window title. If you omit the empty title and the file path contains spaces, CMD may misinterpret the command. Using start "" "file path" avoids that problem.

Before You Begin: Paths, Quotes, and Current Folder

Before you open a file with CMD, confirm three things: the exact file path, whether the path contains spaces, and whether you are in the correct current folder The details matter here..

Find the exact path

A full path looks like this:

C:\Users\Alex\Documents\Project\notes.txt

You can get this path from File Explorer by clicking the address bar, or by right-clicking the file and checking its properties. Accuracy matters. A single wrong folder name will produce an error such as “Windows cannot find the file.

Use quotes around paths with spaces

If the path contains spaces, wrap it in double quotation marks:

start "" "C:\Users\Alex\My Documents\Project Notes\final report.docx"

Without quotes, CMD may treat My and Documents as separate arguments. Quoting the entire path keeps it together.

Change directory with cd /d

If the file is in another drive or folder, you can move to that location first:

cd /d "D:\Work\Reports"

The /d switch allows you to change drives as well as folders. After that, you can open the file by name:

start "" "final report.docx"

This approach is useful when you plan to open several files from the same folder.

Step-by-Step: How to Open a File with CMD

Follow these steps for a reliable result.

  1. Open Command Prompt. Press Win + R, type cmd, and press Enter. You can also search for “Command Prompt” in the Start menu.
  2. handle to the file’s folder if needed. Use cd /d "full folder path" to move to the correct directory.
  3. **Check
Don't Stop

Coming in Hot

More of What You Like

Keep the Momentum

Thank you for reading about How To Open File With Cmd. We hope the information has been useful. Feel free to contact us if you have any questions. See you next time — don't forget to bookmark!
⌂ Back to Home