Microsoft keeps adding new features as they introduce new versions of Windows, and one cool thing they’ve added is the Windows Terminal. This guide will talk about how you can open files and folders with 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
What is Windows Terminal?
Windows Terminal is the new app from Microsoft that lets you use different command-line tools like Command Prompt (CMD), PowerShell, and Azure Cloud Shell all in one place. It usually starts up with PowerShell, which is great for managing your system because it can do more stuff than CMD. But if you’re more into CMD or need it for certain things, you can change your Windows Terminal to start with CMD instead.
Changing the default terminal to CMD in Windows Terminal
If you want to make CMD your go-to in Windows Terminal, here’s how:
- Open Windows Terminal by right-clicking the Start menu and choosing “Windows Terminal (Admin)“.
- Hit the down arrow at the top, near the tabs.
- Pick “Settings” from the menu that pops up.
- On the left, click “Startup“.
- Then, use the dropdown next to “Default profile” to select “Command Prompt“.
- Hit “Save” and restart Windows Terminal to see the change.
Related resource: Add Folder to Path Environment Variable in Windows 11/10
Opening a file in Windows Terminal
Want to open a file with Windows Terminal? Just go to where the file is and tell CMD or PowerShell to open it.
Read: How to Change Directory/Drive in CMD on Windows 11
In Command Prompt:
- Start Windows Terminal in CMD mode.
- Use the
cd
command and the path to get to where your file is. Like,cd C:\Documents
for a file in C:\Documents. - Then, to open the file, type
start
followed by the file’s name, likestart example.txt
.
In PowerShell:
- Start Windows Terminal in PowerShell mode.
- Like in CMD, use
cd
to get to your file’s place. - To open it, type
Invoke-Item
orii
, then the file’s name, likeInvoke-Item example.txt
orii example.txt
.
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 with Windows Terminal, you’ll use a different command in CMD or PowerShell.
In CMD:
- Fire up Windows Terminal in CMD mode.
- Go to your folder with the
cd
command, likecd C:\Documents
. - Then, open the folder by typing
start .
.
In PowerShell:
- Open Windows Terminal in PowerShell mode.
- Get to your folder the same way as in CMD.
- Open it by typing
ii .
.
These steps will get File Explorer up and show you the folder, making it easy to look at and manage your files with a nice graphical view, especially when you want to see everything at once while still using the terminal.
Recommended guide: How to Take Ownership of a File, Folder or Drive in Windows 11
Some additional tips
You can even drag and drop a file or folder into the Windows Terminal window to quickly fill in its path. This trick saves a lot of time, especially if you’re working with files or folders buried deep in your computer.
Windows Terminal also has a search feature. Press Ctrl+Shift+F, and you can search for anything in your terminal session. This is super handy when you’re trying to find something specific in a bunch of text.
If there’s a folder you use a lot, you can make Windows Terminal start there by changing the startingDirectory
in your settings. This way, you’re always where you need to be when you open the terminal.
And if you ever get stuck on a command, both CMD and PowerShell can help. Just type help
followed by the command you’re curious about, and you’ll get all the info you need.
A quick recap
Even though we love clicking and seeing things in graphical interfaces, sometimes they’re not the fastest way to get things done. Command-line interfaces, or CLI for short, are great for quick tasks, automating repetitive stuff, managing files, and more. They’re essential for system admins and anyone who wants to control their computer more directly.
Knowing how to use the command line to open files and folders is a really useful skill. And with Windows Terminal letting you choose between PowerShell and CMD, you can pick the best tool for what you need to do.
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.
-
File Explorer is the default file browser for Windows. To open File Explorer, press the Windows key and «E» at the same time.[1]
-
Use File Explorer to browse to the folder you want to open. Then click the folder to open it.
Advertisement
-
This opens a new Command Prompt window inside the folder you currently have open in File Explorer.[2]
Advertisement
-
File Explorer is the default file browser for Windows. To open File Explorer, press the Windows key and «E» at the same time.
-
Using the panel on the left side of File Explorer, click the folder you want to open. Then click the folder to open it.
-
This displays a context menu next to your mouse cursor.[3]
-
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.
Advertisement
-
It’s the icon that has the Windows logo. It is in the lower-left corner by default. This opens the Windows Start menu.
-
This displays the Command Prompt in the Windows Start menu.
-
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]
-
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.)
-
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.
-
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.
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,595 times.
Is this article up to date?
-
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.
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”.
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.
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”.
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.
Readers help support Windows Report. We may get a commission if you buy through our links.
Read our disclosure page to find out how can you help Windows Report sustain the editorial team. Read more
Microsoft DOS (Disk Operating System) is a command-line platform that was the world’s foremost operating system during the 1980s.
However, DOS declined into irrelevance during the 1990s after Microsoft released Windows 95, which introduced the Start menu.
Nevertheless, Windows has retained a windowed replica of DOS in the form of the Command Prompt. That’s not entirely the same as the 1980s DOS platforms, but it has a similar command set.
You can open folders and files with the Command Prompt instead of File Explorer. This is how you can open folders and files within the Command Prompt.
How can I open files and folders with the Command Prompt?
1. Open the Command Prompt
- Open the Type here to search tool by pressing the Windows key + S hotkey.
- Enter the keyword Command Prompt in the search utility.
- Click Command Prompt to open it.
- You can also right-click Command Prompt and select Run as administrator to open it with admin rights.
2. Opening a folder
- First, enter cd / in the Command Prompt, which will return you to the root C: drive.
- Then you can open a folder in the Command Prompt by entering this change directory command:
cd\folder\subfolder\subfolder
You’ll need to include the root folder and all its subfolders within the path to open a required folder within the Command Prompt.
- Press the Return key after entering the change directory command.
- To display a folder’s file content within the Command Prompt, type dir and press Enter. Then, the Command Prompt will display a file and subfolder list for the folder.
- Fix: Can’t run Command Prompt as admin
- Microsoft Office Lens: A Powerful Tool for Capturing and Organizing Information
3. Opening a file
Alternatively, you can open files in the Command Prompt without moving to their folders first. To do that, you’ll need to enter a command that includes the file’s full folder path and the file title itself.
For example, let’s suppose you need to open a file titled youcam_9.png from the path Users\mav_u\pictures. To do so, you would enter this command:
"C:\Users\mav_u\pictures\youcam_9.png"
That file-opening command must always include quotation marks.
So, who needs File Explorer when you can open folders and files with the Command Prompt instead?
The Command Prompt may not be everybody’s cup of tea, but some users might still prefer its command-line flexibility.
If interested, read this blog to understand how to boot up your computer straight to Command Prompt on Windows 11.
We also have a great guide on how to clear CMD, so be sure to check it out for more useful information. Now that you know how to use the command line, you might be interested in learning what is the root directory on your PC.
Matthew Adams
Windows Hardware Expert
Matthew is a freelancer who has produced a variety of articles on various topics related to technology. His main focus is the Windows OS and all the things surrounding it.
He is passionate about the tech world, always staying up-to-date with the latest and greatest. With an analytical view, he likes problem-solving, focusing on errors and their causes.
In his free time, he likes to read and write about history and tries to always develop new skills.
Программистам часто приходится работать в консоли — например, чтобы запустить тестирование проекта, закоммитить новый код на Github или отредактировать документ в vim. Всё это происходит так часто, что все основные действия с файлами становится быстрее и привычнее выполнять в консоли. Рассказываем и показываем основные команды, которые помогут ускорить работу в терминале под OS Windows.
Для начала нужно установить терминал или запустить командную строку, встроенную в Windows — для этого нажмите Win+R
и введите cmd
. Терминал часто встречается и прямо в редакторах кода, например, в Visual Studio Code.
Чтобы ввести команду в консоль, нужно напечатать её и нажать клавишу Enter
.
Содержимое текущей папки — dir
Выводит список файлов и папок в текущей папке.
C:\content-server>dir
Том в устройстве C имеет метку SYSTEM
Серийный номер тома: 2C89-ED9D
Содержимое папки C:\content-server
06.10.2020 00:41 <DIR> .
06.10.2020 00:37 <DIR> .circleci
16.07.2020 16:04 268 .editorconfig
16.07.2020 16:04 10 .eslintignore
16.07.2020 16:04 482 .eslintrc
06.10.2020 00:37 <DIR> .github
16.07.2020 16:04 77 .gitignore
06.10.2020 00:41 <DIR> assets
06.10.2020 00:41 <DIR> gulp
16.07.2020 16:10 379 gulpfile.js
16.07.2020 16:10 296 320 package-lock.json
16.07.2020 16:10 751 package.json
16.07.2020 16:04 509 README.md
Открыть файл
Чтобы открыть файл в текущей папке, введите его полное имя с расширением. Например, blog.txt или setup.exe.
Перейти в другую папку — cd
Команда cd
без аргументов выводит название текущей папки.
Перейти в папку внутри текущего каталога:
C:\content-server>cd assets
C:\content-server\assets>
Перейти на одну папку вверх:
C:\content-server\assets>cd ..
C:\content-server>
Перейти в папку на другом диске:
c:\content-server>cd /d d:/
d:\>
Чтобы просто изменить диск, введите c:
или d:
.
Создать папку — mkdir или md
Создаём пустую папку code
внутри папки html
:
d:\html>mkdir coded:\html>dir
Содержимое папки d:\html
03.11.2020 19:23 <DIR> .
03.11.2020 19:23 <DIR> ..
03.11.2020 19:25 <DIR> code
0 файлов 0 байт
3 папок 253 389 438 976 байт свободно
Создаём несколько пустых вложенных папок — для этого записываем их через косую черту:
d:\html>mkdir css\js
d:\html>dir
Том в устройстве D имеет метку DATA
Серийный номер тома: 0000-0000
Содержимое папки d:\html
03.11.2020 19:23 <DIR> .
03.11.2020 19:23 <DIR> ..
03.11.2020 19:25 <DIR> code
03.11.2020 19:29 <DIR> css
Создаётся папка css
, внутри которой находится папка js
. Чтобы проверить это, используем команду tree
. Она показывает дерево папок.
Удалить папку — rmdir или rd
Чтобы удалить конкретную папку в текущей, введите команду rmdir
:
d:\html\css>rmdir js
При этом удалить можно только пустую папку. Если попытаться удалить папку, в которой что-то есть, увидим ошибку:
d:\html\css>d:\html>rmdir css
Папка не пуста.
Чтобы удалить дерево папок, используйте ключ /s
. Тогда командная строка запросит подтверждение перед тем, как удалить всё.
d:\html>rmdir css /s
css, вы уверены [Y(да)/N(нет)]? y
Показать дерево папок — tree
В любом момент мы можем увидеть структуру папок. Для этого используется команда tree
.
d:\html>tree
Структура папок тома DATA
Серийный номер тома: 0000-0000
D:.
├───code
└───css
└───js
Если вы хотите посмотреть содержимое всего диска, введите tree
в корне нужного диска. Получится красивая анимация, а если файлов много, то ещё и немного медитативная.
Удаление файла — del или erase
Команда для удаления одного или нескольких файлов.
d:\html>del blog.txt
Переименование файла — ren или rename
Последовательно вводим ren
, старое и новое имя файла.
d:\html>dir
Содержимое папки d:\html
03.11.2020 19:23 <DIR> .
03.11.2020 19:23 <DIR> ..
03.11.2020 19:59 0 blag.txt
d:\html>ren blag.txt blog.txt
d:\html>dir
Содержимое папки d:\html
03.11.2020 19:23 <DIR> .
03.11.2020 19:23 <DIR> ..
03.11.2020 19:59 0 blog.txt
Команды одной строкой
Очистить консоль — cls
.
Информация о системе — systeminfo
.
d:\html>systeminfo
Имя узла: DESKTOP-6MHURG5
Название ОС: Майкрософт Windows 10 Pro
Версия ОС: 10.0.20246 Н/Д построение 20246
Изготовитель ОС: Microsoft Corporation
Параметры ОС: Изолированная рабочая станция
Сборка ОС: Multiprocessor Free
Информация о сетевых настройках — ipconfig
.
d:\html>ipconfig
Настройка протокола IP для Windows
Адаптер Ethernet Ethernet 2:
Состояние среды. . . . . . . . : Среда передачи недоступна.
DNS-суффикс подключения . . . . . :
Список запущенных процессов — tasklist
.
c:\>tasklist
Имя образа PID Имя сессии № сеанса Память
========================= ======== ================ =========== ============
System Idle Process 0 Services 0 8 КБ
System 4 Services 0 2 688 КБ
Secure System 72 Services 0 23 332 КБ
…
Справка по командам — help
Команда help
без аргументов выводит список всех возможных команд. help
вместе с именем команды выведет справку по этой команде.
d:\html>help tree
Графическое представление структуры папок или пути.
TREE [диск:][путь] [/F] [/A]
/F Вывод имён файлов в каждой папке.
/A Использовать символы ASCII вместо символов национальных алфавитов.
В этой статье приведены не все команды и не все их возможности, но вы всегда можете воспользоваться командой help
и узнать о том, что ещё может командная строка.
👉🏻 Больше статей о фронтенде и работе в айти в телеграм-канале.
Подписаться
Материалы по теме
- 10 горячих клавиш VS Code, которые ускорят вашу работу
- Полезные команды для работы с Git
- Полезные команды для работы с Node. js
«Доктайп» — журнал о фронтенде. Читайте, слушайте и учитесь с нами.
ТелеграмПодкастБесплатные учебники