However, learning to work with the command line is a useful skill, as it gives you quick access to functions and operations. For instance, in some situations when working on Command Prompt or PowerShell, you need to open folders or files. You don’t have to exit the window just to find the folder or file.

Open folders & files using Command Prompt & PowerShell

In this guide, I’ll show you how to open folders right from Command Prompt and PowerShell on your Windows 11/10 PC. What you will learn: In the post remember to replace with your username.

1] How to navigate to a folder using Command Prompt and PowerShell

Open the Command prompt by searching for cmd in the Start Menu and selecting Command Prompt. For PowerShell, you can also search for it and open from the Start Menu. Type in the following command and hit ENTER to run it: NOTE: In the above command, replace Path\To\Folder with the actual path to the folder that you want to open. So, it can become: To open a file saved in this folder, input the name of the file and press ENTER. Example, Alternatively, you can enter the full path to the file without using the cd command. For example,

2] How to open a folder using Command Prompt and PowerShell

The first technique would open a file saved in a folder. However, if you wish to open the folder in File Explorer using Command Prompt or PowerShell, you make use of the start command.

Command Prompt

To open a folder, append the folder path after the start command. For example, I can navigate to the New Folder folder using  the following command: If you want to open the current folder, run the start command with a fullstop (.): To open the parent folder to your current folder, use two fullstops (..): On hitting ENTER, the specified folder will open in a File Explorer window.

PowerShell

To open a folder in File Explorer using PowerShell, input either of the following cmdlets – or and add the path to the folder. To open the current directory, use the following command: Read: How to open Folder with Keyboard Shortcut in Windows

3] How to close a file using Command Prompt and PowerShell

To close an already opened file using the command line, you make use of the taskkill command. First, navigate to the folder using the first method: Enter the following command when you are in the correct directory: In the above command, replace the filename part with the name of the file you want to close. Note that this command closes every instant of the open file, and you risk losing unsaved data. Now read: Ways to open a Command Prompt in a Folder. I hope you find the post useful.

How to open a File or Folder using Command Prompt or PowerShell - 19How to open a File or Folder using Command Prompt or PowerShell - 68