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,759 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.
Программистам часто приходится работать в консоли — например, чтобы запустить тестирование проекта, закоммитить новый код на 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
«Доктайп» — журнал о фронтенде. Читайте, слушайте и учитесь с нами.
ТелеграмПодкастБесплатные учебники
Navigating the Windows Terminal to open files and folders is a skill that enhances productivity and efficiency, particularly for those who prefer command-line interfaces (CLI) over graphical user interfaces (GUI). Windows Terminal, a modern application in Windows 11, integrates traditional command-line environments like Command Prompt (CMD) and PowerShell, providing a robust platform for performing a variety of tasks.
To open a file using CMD within Windows Terminal, you first need to navigate to the directory where the file resides using the cd
command. Once there, the start
command, followed by the file name, will open the file with its default application. In the case of PowerShell, navigating to the file’s directory is similar.
Windows Terminal is not just limited to file and folder management; it offers a range of features and customization options, from appearance settings like themes and color schemes to functionality enhancements such as multiple tabs and panes. It also supports various command-line tools, including SSH, Azure Cloud Shell Connector, and the Windows Subsystem For Linux (WSL), making it a versatile tool for developers, system administrators, and power users.
For those new to Windows Terminal or seeking to refine their command-line skills, these fundamental operations form the basis of a much broader set of capabilities. The Terminal’s integration of CMD and PowerShell in a single application, coupled with its extensive customization options, underscores its utility in a modern computing environment. Whether managing files, editing settings, or developing scripts, Windows Terminal in Windows 11 offers a powerful interface for advanced users and novices alike to harness the full potential of their system’s command-line tools.
How to Open a File in Terminal using Command Prompt (CMD)
Opening a file using CMD in Windows Terminal involves navigating to the directory where the file is located and then executing it with its associated application. This method is straightforward and effective for users who prefer or require the use of Command Prompt for their tasks. It’s particularly useful when operating in environments where graphical user interfaces (GUIs) are unavailable or when automating tasks through scripts.
-
Launch Windows TerminalStart by right-clicking the Start button and selecting “Windows Terminal (Admin)”.
- Choose InterfaceIn the Terminal, click the dropdown next to the plus icon. For CMD, select “Command Prompt”.
- Navigate to the File Folder and Open the File
For example, our file is in the “wonder” folder on our desktop. To get there, you would type:
cd C:\Users\User Name\Desktop\wonder
We know that the file is called “cafe” and is a jpeg filetype, so to open it we can just type"cafe.jpg"
and press Enter.
If you’re unsure what your file is called, you can run the commandDIR
while in a folder. This will list every file inside of it in CMD.
-
The File Opens in the Default ProgramThe file will now open in the application associated with its file type.
- Try opening a different file type
This trick works not just with images, but documents and basically any file on your PC that you have the software to open. In the example below, we navigate to a folder on the desktop and then open an Excel worksheet:
cd C:\Users\Maria Winbuzzer\Desktop\wonder
"2019.xlsx"
- Your Excel workbook will open in its default program: Excel
How to Open a File in Terminal using PowerShell
Using PowerShell to open a file in Windows Terminal expands upon CMD’s capabilities by offering more advanced scripting features and cmdlets. PowerShell is a powerful tool for managing Windows systems, and opening files through it can involve more sophisticated commands and scripts. This method is ideal for users who need to incorporate file operations into larger automation tasks or who prefer PowerShell’s extensive command set.
-
Launch Windows TerminalStart by right-clicking the Start button and selecting “Windows Terminal (Admin)”.
- Choose InterfaceIn the Terminal, click the dropdown next to the plus icon. Select “PowerShell”.
- Navigate to your desired folder with “cd”, then type your file name in quotes
For example, our file is in the “downloads” folder. To get there, you would type:
cd C:\Users\User Name\downloads
We know that the file is called “cafe” and is a jpeg filetype, so to open it we can just type"start "cafe.jpg"
and press Enter.
If you’re unsure what your file is called, you can typels
while in a folder. This will list every file inside of it in PowerShell.
- Your file will open in its default program
How to Open a Folder from Terminal using Command Prompt (CMD)
Opening a folder from CMD in Windows Terminal allows users to quickly access directories in File Explorer directly from the command line. This method streamlines the process of switching between the CLI and the GUI, facilitating easier file and directory management. It’s particularly handy when you need to visually inspect the contents of a directory or manipulate files using the GUI after locating them via the command line.
- Type the following command and Press Enter
With Command Prompt selected in your terminal type the following command and substitute the folder path with one to the folder you want to open:start %windir%\explorer.exe "C:\Users\Maria Winbuzzer\Desktop\wonder"
-
The Folder OpensThe specified folder will appear in File Explorer.
How to Open a Folder from Terminal using PowerShell
PowerShell offers a similar functionality to CMD for opening folders, but with the added flexibility and power of PowerShell scripting. Opening a folder in File Explorer from PowerShell within Windows Terminal can be part of a larger script or simply a quick way to access GUI-based file management. This approach is well-suited for users who are already working within a PowerShell session and want to maintain a streamlined workflow.
- Type the following command and Press Enter
With PowerShell selected in terminal, type the following command and substitute the folder path with one to the folder you want to open, like in our case “C:\Users\” for the personal user folder.& "$env:windir\explorer.exe" /select "folder path"
-
The Folder OpensThe specified folder will appear in File Explorer.
FAQ – Frequently Asked Questions About Handling Files, Folders, and Tasks in Windows Terminal
How do I open a file in a specific application from Windows Terminal?
To open a file with a specific application via Windows Terminal, use the command start application.exe “file path” in CMD, where application.exe is the executable name of your application and “file path” is the full path to your file. In PowerShell, use Start-Process -FilePath “application.exe” -ArgumentList “file path”. This explicitly specifies the file path to the application and the argument list with the file you wish to open. Ensure the application can open the file type you’re working with.
How do I create a new file from Windows Terminal?
To create a new file in CMD, navigate to your desired directory and execute echo.> filename.ext, where filename.ext is the name and extension of your new file. This creates a file with minimal content. In PowerShell, the command New-Item filename.ext -ItemType “file” creates a new file in the current directory. Replace filename.ext with the intended name and extension of your file.
How do I copy or move files using Windows Terminal?
In CMD, use copy “source path” “destination path” to copy files, and move “source path” “destination path” to move files. Replace the paths with your file’s current and desired new locations. In PowerShell, use Copy-Item -Path “source path” -Destination “destination path” to copy, and Move-Item -Path “source path” -Destination “destination path” to move files. These commands allow for file management within the terminal environment.
How can I delete a file or folder through Windows Terminal?
To delete a file in CMD, use the command del “filename”. For folders, use rmdir /S /Q “foldername”. In PowerShell, the commands are Remove-Item “filename” -Force for files and Remove-Item “foldername” -Recurse -Force for folders. The -Force and -Recurse parameters in PowerShell ensure deletion of read-only files and all contents within a folder, respectively.
How do I list all files of a specific type in a directory using Terminal?
In CMD, to list files of a specific type, use dir *.ext, replacing *.ext with the desired file extension. This displays all matching files in the current directory. In PowerShell, the command Get-ChildItem -Filter *.ext lists files of a specific type, with the -Filter parameter allowing you to specify the desired file extension or pattern.
How do I see hidden files in a directory from Windows Terminal?
To list hidden files in CMD, use the command dir /A:H. In PowerShell, the equivalent command is Get-ChildItem -Force, which reveals hidden files and directories in the listing by overriding the default behavior to hide certain items.
How can I change file attributes from Windows Terminal?
In CMD, use attrib +AttributeType filename to add an attribute or attrib -AttributeType filename to remove an attribute from a file, where AttributeType could be R (read-only), H (hidden), S (system), or A (archive). In PowerShell, use Get-Item “filename” | Set-ItemProperty -Name Attributes -Value “ReadOnly, Hidden” to manage file attributes in a more structured manner.
How do I find the current version of Windows from Terminal?
In CMD, systeminfo | findstr /B /C:”OS Name” /C:”OS Version” filters the output to show only the OS name and version. In PowerShell, use Get-ComputerInfo -Property “OsName”, “OsVersion” to display the operating system name and version in a formatted output, providing a clear view of your current Windows version.
How do I terminate a running process using Windows Terminal?
In CMD, use taskkill /IM “processname.exe” /F to forcibly terminate a process, replacing “processname.exe” with the actual process name. The /F parameter forces the command to stop the specified process. In PowerShell, the command Stop-Process -Name “processname” -Force achieves a similar outcome, with -Name specifying the process by name and -Force ensuring the process is terminated, providing a method to manage running processes effectively.
How can I view the network configuration and active connections in Terminal?
In CMD, ipconfig displays the current network adapter configuration, while netstat lists active connections and listening ports. In PowerShell, Get-NetIPConfiguration provides detailed network configuration info, and Get-NetTCPConnection shows active TCP connections, offering insights into network activity with structured output and filtering options.
How do I schedule tasks from Windows Terminal?
CMD’s schtasks utility allows for comprehensive task scheduling, such as creating, modifying, and querying tasks. Use schtasks /create with appropriate parameters to set up new tasks. In PowerShell, combine New-ScheduledTask, New-ScheduledTaskAction, and Register-ScheduledTask for granular task scheduling, with each cmdlet providing specific functionalities for creating and managing scheduled tasks in a more detailed manner.
How do I compress or extract files using Windows Terminal?
To compress files in CMD, use compact /c /s:”directory” “filename” and expand “source” “destination” to extract. PowerShell’s Compress-Archive and Expand-Archive cmdlets offer straightforward commands for compressing and extracting files, respectively, providing a simple and efficient way to manage file compression and extraction within Windows Terminal.
How can I update Windows from the Terminal?
Although CMD doesn’t provide a direct command for Windows updates, PowerShell enables launching the update interface with Start-Process “ms-settings:windowsupdate”. This command opens the Windows Update settings, allowing manual check and installation of updates, serving as a bridge to Windows Update functionality from the Terminal.
How do I repair system files from Windows Terminal?
The sfc /scannow command in CMD scans and repairs system files by replacing corrupted files with a cached copy. This tool is crucial for system integrity. In PowerShell, the same command can be used to perform system file checks and repairs, maintaining system health and troubleshooting issues effectively.
How can I manage Windows Firewall settings through Terminal?
CMD provides netsh advfirewall commands for Windows Firewall configuration, such as enabling/disabling the firewall and setting rules. PowerShell introduces cmdlets like Get-NetFirewallRule and New-NetFirewallRule for viewing and creating firewall rules, offering a structured approach to firewall management with detailed rule configuration parameters, enhancing security management capabilities within the Terminal.
Related: How to Open Command Prompt with the “Open Command Window Here” in File Explorer
Related: How to Enable PowerShell Scripts via PowerShell Execution Policy
PowerShell is a powerful tool that many, including myself, don’t use to its full potential. That’s why most of us rely on PowerShell scripts crafted by others, but this can have its own hurdles. Often, you’ll see errors like “PowerShell: running scripts is disabled on this system”. To Enable PowerShell scripts in Windows, you must first set the execution policy. In our other guide, we show you how to enable PowerShell scripts in Windows by setting your execution policy via the command-line.
Related: How to Stop, Start, and Restart a Service with Command Prompt
As we mentioned, there are hundreds of things you can do with Command Prompt rather than using the UI. One of them is managing your services. You can learn how by following our dedicated guide here.
Related: How to Run Microsoft Defender from the Command Line (CMD)
Knowing how to run Microsoft Defender (formerly Windows Defender) from the command line can be very useful. Perhaps you’ve been locked out of its UI due to malware, are trying to run a scan from recovery media, or are using a GUI-less Windows Server install. In any of these situations, knowing a scan command or two can save you a lot of trouble. In our other tutorial, we show you how to use Microsoft Defender via CMD commands.
Last Updated on November 7, 2024 9:48 pm CET