How to Open a File or Folder in Windows 11 Terminal (CMD)

Published by Nyau Wai Hoe - Updated on

As Microsoft continues to develop its operating systems, we see the emergence of new tools and features designed to enhance user experience and productivity. A significant addition in this regard is the Windows Terminal. This article will guide you through the process of opening files and folders using Windows Terminal’s Command Prompt (CMD) or PowerShell on Windows 11.

Also see: How to Download an FTP File Using CMD in Windows 11/10

How to Open a File or Folder in Windows 11 Terminal CMD

What is Windows Terminal?

Windows Terminal is a modern terminal application introduced by Microsoft. It facilitates the use of different command-line environments under one unified window. This includes the traditional Command Prompt (CMD), PowerShell, Azure Cloud Shell, and others.

By default, Windows Terminal launches with PowerShell, a task-based command-line shell built on .NET. It’s especially designed for system administration, offering more functionalities compared to CMD. However, if you prefer using CMD or have specific tasks that require it, you can modify your Windows Terminal settings to launch CMD by default.

Changing the default terminal to CMD in Windows Terminal

Should you wish to default to the Command Prompt in Windows Terminal, you can do so by following these steps:

  1. Launch Windows Terminal by simply right-clicking the Start menu and selecting “Windows Terminal (Admin)“.Open Windows Terminal Admin in Windows 11
  2. Click on the downward arrow located at the top of the application, next to the tabs.
  3. Select “Settings” from the dropdown menu.
  4. In the left pane, choose “Startup“.
  5. On the right, click the drop-down menu next to “Default profile” and select “Command Prompt” (or whichever terminal you want to switch to).Change Windows Terminal default to CMD
  6. Click “Save” to save the changes.
  7. Restart your Windows Terminal to see it open Command Prompt as the default terminal.

Related resource: Add Folder to Path Environment Variable in Windows 11/10

Opening a file in Windows Terminal

To open a file using Windows Terminal’s Command Prompt or PowerShell, you need to navigate to the directory that contains the file, and then call the appropriate command to open the file.

Read: How to Change Directory/Drive in CMD on Windows 11

In Command Prompt:

  1. Open Windows Terminal in CMD.
  2. Use the cd command followed by the directory path to navigate to the directory that contains the file. For example, if the file is in C:\Documents, you would type: cd C:\Documents.
  3. Once you’re in the correct directory, use the start command followed by the filename to open the file. For example, if the file is named example.txt, you would type: start example.txt.

Open file in Windows Terminal CMD

In PowerShell:

  1. Open Windows Terminal in PowerShell.
  2. Use the cd command followed by the directory path to navigate to the directory that contains the file, similar to CMD.
  3. To open the file, use the Invoke-Item command, or its alias ii, followed by the filename. For example, if the file is named example.txt, you would type: Invoke-Item example.txt or ii example.txt.

Open files Windows Terminal PowerShell command

Useful tip: What is “Copy as Path” in Windows 11 and what does it do?

Opening a folder via Windows Terminal

To open a folder in File Explorer using the command line interface in Windows Terminal, you will use different commands based on whether you are operating in CMD or PowerShell.

In CMD:

  1. Open Windows Terminal in CMD.
  2. Use the cd command followed by the directory path to navigate to the desired folder. For example, if you want to open the folder at C:\Documents, you would type: cd C:\Documents.
  3. Once you’re in the correct directory, use the start command followed by a period to open the folder in File Explorer. Simply type: start ..

Open a folder in Windows Terminal CMD

In PowerShell:

  1. Open Windows Terminal in PowerShell.
  2. Use the cd command followed by the directory path to navigate to the desired folder, similar to CMD.
  3. To open the folder in File Explorer, use the ii command (an alias for Invoke-Item) followed by a period. Simply type: ii ..

Open a folder in File Explorer using command in Windows Terminal

These commands will launch File Explorer and directly open the folder you specified, allowing you to view and manage the files in a GUI-based environment. This method is particularly useful when you wish to switch to a graphical interface for file management tasks or when you need to visually cross-reference the contents of a directory while working in the terminal.

Recommended guide: How to Take Ownership of a File, Folder or Drive in Windows 11

Additional tips

You can also drag and drop a file or folder into the Windows Terminal window to automatically fill in its path. This can be a time-saver, especially when working with files or folders located in deeply nested directories.

Another handy feature of Windows Terminal is its built-in search functionality. By pressing Ctrl+Shift+F, you can easily search for text within your current terminal session. This is especially useful when you’re sifting through large amounts of output.

Furthermore, if you find yourself often working with a specific directory, you can set it as your default directory in Windows Terminal. To do this, you’ll need to modify the startingDirectory setting in your profile in the settings file.

Finally, remember that both CMD and PowerShell have extensive help systems. If you’re ever unsure about a command, you can type help followed by the command name to get more information about how to use it.

Windows Terminal Help Command

Wrapping up

While GUIs are user-friendly and visually appealing, they sometimes fall short in terms of efficiency and automation potential. CLI, on the other hand, shines in these areas. It allows for the creation of scripts that can automate repetitive tasks, perform complex file management operations, and even interact with network resources, making it an indispensable tool for system administrators and power users.

Whether you’re a seasoned system administrator or a developer, learning how to navigate and open your files and folders from the command line is an invaluable skill. And with the flexibility to switch between PowerShell and CMD in Windows Terminal, you can always choose the right tool for the job.


Nyau Wai Hoe
Nyau Wai Hoe is the Founder and Chief Editor of WindowsDigitals.com. With a degree in software engineering and over 12 years of experience in the tech support industry, Nyau has established himself as an expert in the field, with a primary focus on the Microsoft Windows operating system. As a tech enthusiast, he loves exploring new technologies and leveraging them to solve real-life problems.

Share via
Copy link