Back to News Hub
📈Aakash Gupta
June 12, 2026
Research

How to Open Files in CMD: A Quick Guide for 2026

Overview

This guide explains how to open files directly from the Windows Command Prompt (CMD), allowing users to quickly access files and folders without navigating through Windows Explorer. Whether you need to view config files, datasets, or logs shared by colleagues, CMD offers faster alternatives to manual folder browsing.

Key Takeaways

  • Use the 'start' command followed by a file path to open files with their default application from CMD.
  • The 'explorer' command opens Windows Explorer to a specific folder location directly from the command line.
  • Type 'type filename' to view file contents in CMD without opening a separate application.
  • PowerShell and CMD both support file opening, with slightly different syntax and capabilities for advanced users.
  • Learning CMD file operations saves time during development workflows and technical troubleshooting sessions.
How to Open Files in CMD: A Quick Guide for 2026

Basic File Opening with the START Command

The simplest way to open a file from CMD is using the START command, which launches files with their associated default application.

  • ›Type 'start filename.txt' to open a text file in your default text editor
  • ›Use full paths for files not in the current directory: 'start C:\Users\Documents\report.pdf'
  • ›The START command works with any file type that has a registered application association
  • ›Add quotes around paths containing spaces: 'start "C:\Program Files\Data\myfile.doc"'

The START command is the most straightforward method for opening files from CMD. When you execute this command, Windows automatically detects the file type and launches the appropriate application. For example, 'start document.docx' will open the file in Microsoft Word if Word is your default application for that file type. This approach is particularly useful when you have a file path copied from an email or chat and want to view it immediately without manually searching through folders.

Opening Folders with Windows Explorer from CMD

When you need to browse an entire folder rather than a single file, the explorer command provides direct access to Windows Explorer.

  • ›Type 'explorer C:\path\to\folder' to open a specific folder in Windows Explorer
  • ›Use 'explorer .' to open the current working directory in a graphical interface
  • ›Combine with the START command for more control: 'start explorer.exe C:\Logs\'
  • ›This method bridges the gap between CLI efficiency and GUI convenience for file browsing

The explorer command is ideal when you need to visually inspect multiple files or navigate a complex folder structure. Instead of typing individual file names, you can open the entire directory and see thumbnails, file sizes, and modification dates at a glance. This hybrid approach lets you leverage CMD's speed for reaching the right location, then use Explorer's visual interface for actual file management and inspection.

Viewing File Contents Directly in CMD

Sometimes you don't need to open a file in an external application-you just need to see what's inside it from the command line.

  • ›Use 'type filename.txt' to display text file contents directly in the CMD window
  • ›Pipe output to 'more' for long files: 'type largefile.txt | more' to scroll through content page by page
  • ›Try 'cat filename.txt' in PowerShell for similar functionality with additional options
  • ›This method is fastest for quick inspection of logs, config files, and small datasets without launching applications

The TYPE command is incredibly useful for engineers and system administrators who frequently need to check configuration files, error logs, or data samples. Rather than opening Notepad or another editor, you can instantly see file contents right in your terminal. This is especially helpful when you're already working in CMD and want to maintain focus without switching windows. For larger files, the FIND command can help you search within the file without displaying everything: 'find "error" logfile.txt' will show only lines containing "error".

Advanced Options: Using PowerShell for File Operations

PowerShell offers more sophisticated file-opening capabilities and is increasingly the preferred choice for Windows automation and scripting.

  • ›Use 'Invoke-Item filename' in PowerShell to open files with their default application
  • ›PowerShell supports piping and filtering, allowing you to open files conditionally based on name or type
  • ›Combine with Get-ChildItem to open multiple related files: 'Get-ChildItem *.log | Invoke-Item'
  • ›PowerShell's object-based approach provides more control than traditional CMD for complex file operations

PowerShell is a modern alternative to CMD that integrates more seamlessly with Windows applications and services. The Invoke-Item cmdlet is roughly equivalent to the START command but fits PowerShell's consistent syntax pattern. If you work with multiple files or need conditional logic-such as opening only files modified in the last day-PowerShell's cmdlets provide cleaner, more readable syntax. Many modern development workflows recommend learning PowerShell basics alongside or instead of traditional CMD for better long-term productivity.

Common Use Cases and Real-World Scenarios

These CMD file-opening techniques prove valuable in several common workplace and development situations.

  • ›A colleague shares a network path to a shared dataset-use 'start \\server\share\file.csv' to open it immediately
  • ›Quick log file inspection during troubleshooting-use 'type error.log' to diagnose issues without switching applications
  • ›Opening recent project files while working on build automation scripts
  • ›Accessing system configuration files during server maintenance and diagnostics

In practical scenarios, these methods shine during technical calls and collaborative work. When someone says "check the config in C:\App\config.ini," you can type 'start C:\App\config.ini' and have it open in seconds rather than navigating through folders. During incident response, opening logs directly from CMD lets you stay in your working terminal and maintain context. For developers building scripts or automation, knowing how to access files from the command line reduces dependency on the GUI and supports repeatable, scriptable workflows.

Tips for Efficient File Access in CMD

These practical tips can significantly speed up your file-opening workflow and reduce typing errors.

  • ›Use tab completion: start typing a path and press Tab to auto-complete file and folder names
  • ›Copy full paths from Windows Explorer's address bar and paste into CMD for accuracy
  • ›Create command aliases for frequently accessed folders to save time on repeated tasks
  • ›Remember that dragging a folder into the CMD window automatically pastes its full path

Efficiency gains in CMD come from learning keyboard shortcuts and system features that reduce manual typing. Tab completion is particularly powerful-it catches typos and handles spaces in folder names automatically. If you frequently access the same locations, consider creating batch files or PowerShell scripts that open multiple related files with a single command. The drag-and-drop method is underrated: dragging a file or folder into your CMD window instantly inserts its full path, complete with proper quoting for spaces.

Troubleshooting Common Issues

Sometimes file-opening commands don't work as expected. Here's how to diagnose and fix the most common problems.

  • ›"File not found" error-verify the file path is correct and use absolute paths when in doubt
  • ›Application not launching-check that the file type has a registered default application on your system
  • ›Permission denied messages-ensure you have read access to the file location; run CMD as administrator if necessary
  • ›Incorrect application launching-right-click a file in Explorer, select 'Open with,' and set your preferred default application

The most common issue is path-related. Windows CMD is particular about path separators and special characters. Always use backslashes (\) for Windows paths, not forward slashes. If a path contains spaces, wrap it in quotes. Another frequent problem occurs when file extensions lack default applications-you can manually associate file types through Windows settings or specify the application explicitly in your command, such as 'notepad.exe filename.log' to force opening with Notepad regardless of the default.

Frequently Asked Questions

What's the difference between the START and EXPLORER commands?

START opens a file with its default associated application, while EXPLORER opens Windows Explorer to browse a folder. Use START for specific files you want to view in their native application, and EXPLORER when you need to visually browse multiple files or manage a folder.

Can I open multiple files at once from CMD?

Yes. In PowerShell, use 'Get-ChildItem *.txt | Invoke-Item' to open all text files. In traditional CMD, you can run multiple START commands in sequence: 'start file1.txt & start file2.txt' will open both files.

How do I open a file with a specific application from CMD?

Specify the application path directly: 'start notepad.exe C:\file.txt' opens the file in Notepad. Or use 'start "" "C:\Program Files\AppName\app.exe" "C:\file.txt"' for applications in Program Files folders.

Is PowerShell better than CMD for file operations?

PowerShell is more modern and powerful for complex automation, but CMD is simpler for quick file access. PowerShell is recommended for new learners and scripting, while CMD still works fine for simple operations.

Mastering these CMD file-opening techniques eliminates friction from your workflow and keeps you productive in the command line.

Continue Learning

Originally published by Aakash Gupta
Read the original

Comments

Sign in to join the conversation