Как открыть папку в консоли windows 10

  • Home
  • News
  • How to Open a File/Folder in Command Prompt (CMD) Windows 10

By Alisa |
Last Updated

Wonder how to open a file cmd or how to open a folder in Command Prompt on Windows 10? This tutorial provides a step-by-step guide. Also, if you can’t find some files or folders in Windows 10, or some files are unexpectedly lost in your Windows 10 computer, MiniTool free data recovery software for Windows 10/8/7 can help you easily recover lost files.

You can also open files from Command Prompt. Wonder how to open a file or folder in Command Prompt on Windows 10? Check the step-by-step guide in this tutorial.

How to Open a File CMD Windows 10 in 2 Steps

Step 1 – Open Command Prompt

You have several ways to open Command Prompt in Windows 10.

You can press Windows + R keys on the keyboard to open Windows Run dialog. Then type cmd in the Run box. If you want to run Command Prompt as Administrator, you need to press Ctrl + Shift + Enter keys at the same time.

Alternatively, you can also click Start or Search box in Windows 10, and type cmd or command prompt. Right-click the Command Prompt app in the list and choose Run as administrator.

Step 2 – Open Files from Command Prompt

Normally you have two ways to open a file using cmd. One is to move the folder that the file is in, the other is to open the files directly in Command Prompt.

Method 1. How to open a file with cmd by moving to the folder firstly

  • You can use the cd command to move to the exact folder the file lies in. For instance, cd C:\Users\mini\Desktop.
  • After you are in the correct folder path, you can type the name of the file with its extension, e.g. “travel.png”, and hit Enter button to open it.

how to open a file cmd

Method 2. How to open a file using cmd directly

You can also choose to open files from Command Prompt on Windows 10 directly, instead of going to the folder path. You can input the full path, file name and its file extension to open the target file, e.g. “C:\Users\mini\Desktop\travel.png”.

open files from Command Prompt

You can also freely specify an app to open the file. You need to type the whole path of the app ahead of the path of the file, for example, “%windir%\system32\mspaint.exe” “C:\Users\mini\Desktop\travel.png”. Press Enter to open the file using CMD.

specify an app to open a file in Command Prompt

How to Open a Folder in Command Prompt Windows 10

You can also open a folder from Command Prompt with the command line below.

After you enter into Command Prompt window by following the operation above, you can open a folder in File Explorer in Command Prompt. The command line can be like this, start %windir%\explorer.exe “C:\Users\mini\Desktop”.

how to open a folder in Command Prompt

Tip: Need to mention that you need to enclose the path of a file or folder in double quotation marks, since some folder or files names have spaces in them.

>> Quick Video Guide:

To Recover Unexpectedly Lost Files or Folders in Windows 10

Sometimes you may suffer unexpected data loss in Windows 10 due to various reasons, e.g. system crash, Blue Screen error (e.g. Bad Pool Caller BSOD error), power outage, malware/virus infection, hard drive failure, etc. To easily recover lost data for free, you can choose the best free data recovery software to realize it.

MiniTool Power Data Recovery, a 100% clean and free data recovery software for Windows 10/8/7, enables you to easily recover mistakenly deleted files or lost files from computer local drive, external hard drive, SSD drive, USB drive (pen drive data recovery), SD card, and more.

MiniTool Power Data Recovery TrialClick to Download100%Clean & Safe

About The Author

Position: Columnist

Alisa is a professional English editor with 4-year experience. She loves writing and focuses on sharing detailed solutions and thoughts for computer problems, data recovery & backup, digital gadgets, tech news, etc. Through her articles, users can always easily get related problems solved and find what they want. In spare time, she likes basketball, badminton, tennis, cycling, running, and singing. She is very funny and energetic in life, and always brings friends lots of laughs.

The Command Prompt can do a lot things the Windows 10 UI doesn’t give you simple, quick access to. It can also do some basic stuff like open files and folders. The commands you need for it are pretty simple. Here’s how you can open files and folders from the Command Prompt.

The only real trick to opening a file from the Command Prompt is moving to the correct folder that the file is in. You can do that, or you can give the full path to the file you want to open.

Move to folder

If you’re going to move to the folder that the file is in, you need to use the cd command.

Syntax

cd path-to-folder

Example

cd C:\Users\fatiw\Desktop

Once you’re in the correct folder, enter the name of the file you want to open with its extension and tap enter.

Open file directly

To open the file directly, instead of moving to the folder, you need to specify the path with the name of the file you want to open, with the file extension.

Syntax

path-to-folder FileName.FileExtension

Example

"C:\Users\fatiw\Desktop\audio cut.jpg"

By default, Command Prompt will open the file in the default app that is set for it however, if you want, you can specify a different app to open the file.

Syntax

Path-to-app app-EXE-name path-to-file FileName.FileExtension

Example

"C:\Program Files\Adobe\Adobe Photoshop CC 2018\Photoshop.exe" "C:\Users\fatiw\Desktop\audio cut.jpg"

Open folder from Command Prompt

To open a folder in File Explorer from Command Prompt, you need to run the following command.

Syntax

start %windir%\explorer.exe path-to-folder

Example

start %windir%\explorer.exe "C:\Users\fatiw\Desktop"

Since we’re just opening files and folders, you don’t need to open Command Prompt with admin rights. The commands will work regardless what privileges Command Prompt is running with.

One thing you ought to know about providing the path to a file or folder is that you need to enclose it in double-quotes. This is normal since most folder and file names have a space in them. If you neglect to use the double-quotes, the command won’t run. If your file name and folder path don’t have any spaces in them, feel free to run the commands without the double-quotes.

Close File

You can also use Command Prompt to close a file. The command is;

Syntax

taskkill /im filename.exe /t

Example

taskkill /im i_view64.exe /t

Of course, if an app is able to run multiple instances, like IrfanView or Microsoft Word, the command will close all the files that are open. You might lose unsaved progress so be careful with this one.

default avatar image

Fatima Wahab

Fatima has been writing for AddictiveTips for six years. She began as a junior writer and has been working as the Editor in Chief since 2014.

Fatima gets an adrenaline rush from figuring out how technology works, and how to manipulate it. A well-designed app, something that solves a common everyday problem and looks

Thanks to the graphical user interface of Windows 10, users can get just about anything done by simply clicking on the icon. Without the GUI, we’d have been forced to do everything from the command line in PowerShell or Command Prompt.

Open folders & files using Command Prompt & PowerShell

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:

  1. How to navigate to a folder using Command Prompt and PowerShell.
  2. How to open a folder using Command Prompt and PowerShell.
  3. How to close a file using Command Prompt and PowerShell.

In the post remember to replace <username> 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:

cd Path\To\Folder

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:

cd C:\Users\<username>\Desktop\New Folder

To open a file saved in this folder, input the name of the file and press ENTER. Example,

Path\To\Folder new-file.txt

Alternatively, you can enter the full path to the file without using the cd command. For example,

C:\Users\<username>\Desktop\New Folder\new_file.txt

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:

start C:\Users\<username>\Desktop\New Folder

If you want to open the current folder, run the start command with a fullstop (.):

start .

To open the parent folder to your current folder, use two fullstops (..):

start ..

On hitting ENTER, the specified folder will open in a File Explorer window.

Read: How to open Folder with Keyboard Shortcut in Windows

PowerShell

To open a folder in File Explorer using PowerShell, input either of the following cmdlets –

Invoke-Item

or

ii

and add the path to the folder.

ii C:\Users\<username>\Desktop\New Folder

To open the current directory, use the following command:

ii

TIP: This post will show you how to create, delete, find, rename, compress, hide, move, copy and manage a file or folder using Command Prompt

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:

C:\Path\To\Folder

Enter the following command when you are in the correct directory:

taskkill /im filename.exe /t

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.

Download Article

Download Article

Do you need to access a certain folder at the Windows command prompt? The command prompt might seem archaic, but it’s actually really easy once you learn some basic commands. This wikiHow article will show you how to use the «cd» command to open a folder at the Windows command prompt. We’ll also show you a cool trick that will help you instantly open a command prompt from any folder using Windows File Explorer.

  1. Step 1 Press ⊞ Win+E to open File Explorer icon.

    File Explorer is the default file browser for Windows. To open File Explorer, press the Windows key and «E» at the same time.[1]

  2. Step 2 Navigate to the folder you want to open in Command Prompt.

    Use File Explorer to browse to the folder you want to open. Then click the folder to open it.

    Advertisement

  3. Step 3 Type cmd in the address bar and press ↵ Enter.

    This opens a new Command Prompt window inside the folder you currently have open in File Explorer.[2]

  4. Advertisement

  1. Step 1 Press ⊞ Win+E to open File Explorer icon.

    File Explorer is the default file browser for Windows. To open File Explorer, press the Windows key and «E» at the same time.

  2. Step 2 Navigate to the folder you want to open in Command Prompt.

    Using the panel on the left side of File Explorer, click the folder you want to open. Then click the folder to open it.

  3. Step 3 Hold ⇧ Shift and right-click any blank space in the folder.

    This displays a context menu next to your mouse cursor.[3]

  4. Step 4 Click Open command window here.

    This opens the Command Prompt inside the folder.[4]

    • On newer versions of Windows, this option has changed to Open PowerShell window here. PowerShell is a more advanced version of Command Prompt. Most commands that work in Command Prompt will also work in PowerShell.
  5. Advertisement

  1. Step 1 Click the Windows Start button icon.

    It’s the icon that has the Windows logo. It is in the lower-left corner by default. This opens the Windows Start menu.

  2. Step 2 Type CMD.

    This displays the Command Prompt in the Windows Start menu.

  3. Step 3 Click the Command Prompt icon icon.

    It has an icon that resembles a black screen with a white text cursor. Click the Command Prompt icon in the Windows Start menu to open Command Prompt.[5]

  4. Step 4 Type the drive the folder is in and press ↵ Enter.

    If the folder you want to open is on a different drive other than the drive your Windows operating system is installed on, you need to switch to that drive in Command Prompt. To do so, type the letter of the drive followed by a colon (e.g. «D:») and then press Enter.

    • You only need to do this if the folder is not located on the drive that Windows is installed on (which is usually the «C:» drive.)
  5. Step 5 Type cd followed by a space.

    The «cd» command is used to change directories in the Windows command prompt. Type «cd» followed by a space, but do not press Enter just yet.

  6. Step 6 Type the address of the folder after the space and press ↵ Enter.

    You’ll need to include every folder and sub-folder the folder is located in. Place a backslash («\») in front of each folder name. For example; «cd \Users\username\Documents.»[6]

    • If you are not sure what the path of the folder is, you can navigate to the folder in File Explorer. Right-click the address bar at the top and click Copy address as text. You can then press Ctrl + V to paste the path of the folder directly into Command Prompt right after the «cd» command.
  7. Advertisement

Ask a Question

200 characters left

Include your email address to get a message when this question is answered.

Submit

Advertisement

Video

Thanks for submitting a tip for review!

Thanks for reading our article! If you’d like to learn more about Computer Networking, check out our in-depth interview with Stan Kats.

References

About This Article

Article SummaryX

1. Click the Windows Start menu and type «cmd».
2. Click the Command Prompt icon to open it.
3. Type «cd» followed by a space.
4. Type the address of the folder after the space (i.e. «/Users/username/Documents.»)
5. Press Enter.

Did this summary help you?

Thanks to all authors for creating a page that has been read 552,759 times.

Is this article up to date?

Quick Tips

  • Open CMD, enter cd followed by the folder path to change the directory to the folder you want to open.
  • Enter start to open the folder after you change the directory.
  • To open a file, change the directory, and then enter the file path to open the file.

How to Open a File Using Command Prompt on Windows

Here’s how you can easily open Command Prompt on your PC and use it to access a file. However, you must know the file’s path on your PC before proceeding with the steps.

Step 1: Open the Command Prompt app from the start menu.

Open Command Prompt 17

Step 2: Now, type cd, followed by folder path, and hit enter.

cd "folder_path"

To copy the path of any folder, right-click on the folder and click on ‘Copy as Path’. Our folder path here is “C:\Users\rsupr\OneDrive\Desktop\Sample Folder”.

Note: Ensure to enter all the paths within double quotes.

Enter Folder Path

Step 3: Next, enter the file name and its extension in double-quotes.

The name of the file we are using is “Sample Image” and its extension is “.png”.

Step 4: Hit the enter key, and the file will open.

Open File in CMD

Also Read: Create a folder or file from Windows Command Prompt

How to Open a Folder Using Command Prompt

Step 1: Open the Command Prompt app from the start menu.

Open Command Prompt 17

Step 2: Now, type cd and paste the path of the folder you want to open. Once done, hit enter.

cd "folder_path"

To copy the path of any folder, right-click on the folder and click on ‘Copy as Path’. Our folder path here is “C:\Users\rsupr\OneDrive\Desktop\Sample Folder”.

Note: Ensure to enter all the paths within double quotes.

Enter Folder Path

Step 3: Next, enter the following command to open the folder on your PC. Hit the enter key.

start .
Open Folder

How to Delete Files Using CMD on Windows

You can also delete files using simple commands on CMD in Windows. However, this permanently deletes the file, so proceed with caution.

1. Delete Individual File

Step 1: Open the Command Prompt app from the start menu.

Open Command Prompt 17

Step 2: Now, type cd, followed by the file’s path you want to delete. Hit the enter key.

cd "folder_path"

To copy the path of any folder, right-click on the folder and click on ‘Copy as Path’. Our folder path here is “C:\Users\rsupr\OneDrive\Desktop\Sample Folder”.

Note: Ensure to enter all the paths within double quotes.

Enter Folder Path 1

Step 3: Type del followed by the name of the file you want to delete. Hit the enter key.

Ensure to enter the filename and its extension within double quotes. The name and extension of the file we are using are “Sample Image” and “.png”.

Delete File in CMD

2. Delete All Files Within a Folder

You can also permanently delete a folder’s contents at once using a single command. Here’s how:

Step 1: Open the Command Prompt app from the start menu.

Open Command Prompt 17

Step 2: Now, type del and paste the path of the folder whose contents you want to delete. Hit the enter key.

del "folder_path"

To copy the path of any folder, right-click on the folder and click on ‘Copy as Path’. Our folder path here is “C:\Users\rsupr\OneDrive\Desktop\Sample Folder”.

Delete Folder

Step 3: Type ‘Y’ to confirm your action or ‘N’ to abort the process and hit the enter key.

Type Y or N

Also Read: How to view Command Prompt (CMD) history on Windows.

Bonus: Copy or Move Files to Different Locations Using CMD

You can also copy or move files from one destination to another on your Windows PC within CMD. Here’s how:

Step 1: Open Command Prompt from the start menu.

Open Command Prompt 17

Step 2: Now, type cd and paste the path of the file you want to copy or move. Hit the enter key.

cd "folder_path"

To copy the path of any folder, right-click on the folder and click on ‘Copy as Path’. Our folder path here is “C:\Users\rsupr\OneDrive\Desktop\Sample Folder”.

Enter Folder Path 2

  • To copy a file to a different location, type copy and the source file’s name and the destination folder’s path. Once done, press enter.
copy "filename.extension" "destination_path"

Our file is “Sample Image.png” and the destination path is “C:\Users\rsupr\OneDrive\Documents”.

Note: Ensure to enter all the paths, the filename, and its extension within double quotes.

File Copied

Note: If a file of the same name exists in the destination folder, you will receive a prompt whether you want to overwrite the file or abort the process. Type Y (yes) to overwrite or N (no) to abort, and hit enter.

Copy Prompt

  • To move a file to a different location, type move, followed by the source file’s name and the destination folder’s path. Now, hit enter.
move "filename.extension" "destination_path"

Our file is “Sample Image.png” and the destination path is “C:\Users\rsupr\OneDrive\Documents”.

Note: Ensure to enter all the paths, the filename, and its extension within double quotes

Move File Using CMD 1

Note: If a file of the same name exists in the destination folder, you will receive a prompt whether you want to overwrite the file or abort the process. Type Y (yes) to overwrite or N (no) to abort and hit enter key.

Move Prompt

That is everything you need to know on how to open files and folders using CMD on Windows. If you have any further questions, move to the following section.

FAQs on Opening Files Using Command Prompt

1. Do I need to open Command Prompt as an administrator to open files?

No, you do not need to open Command Prompt as an administrator to open, delete, move/copy files on your Windows PC.

2. Why is CMD showing errors when I am trying to open a file?

Ensure you use the ‘cd’ command before entering a directory. Further, ensure that all paths and filenames are enclosed within double quotes. Make sure to include the extension of the filename as well.

3. How to open a folder using CMD?

All you need to do is to type ‘cd’ and enter the path of the folder in double quotes. This will open the folder to CMD, and you can type the file names present in the folder to open it.

4. How do I find the full name of a file along with its extension?

Right-click on the filename, select properties, and select the General tab. You can see the file’s full name and its extension in the ‘Type of File’ section.

Was this helpful?

Thanks for your feedback!

The article above may contain affiliate links which help support Guiding Tech. The content remains unbiased and authentic and will never affect our editorial integrity.

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Автоматизация windows с помощью python
  • Linux vnc client windows
  • Универсальный драйвер для принтеров samsung для windows 10 x64
  • Как поменять системный звук на windows 10
  • Файлы в корневом каталоге windows 7