This tutorial gives a detailed guide on how to change directory in CMD (Command Prompt) in Windows 10 computer. Learn how to use CD command in Windows Command Prompt to access different directories and folders. FYI, MiniTool software designs a free data recovery software program allowing you to recover any deleted/lost files from Windows 10/8/7 computer and other storage devices.
On This Page :
Windows Command Prompt (cmd.exe) lets you do many things quickly on your Windows computer. Wonder how to change directory in CMD? You can use the CD command to easily do this.
What Is CD Command in Windows?
The CD command refers to “change directory”. It is a professional Windows Command Prompt change directory command. You can use CD command to easily change the current working directory in CMD in Windows 10, and open different directories or folders on your Windows 10 computer. Check how to use CD command to change directory in Command Prompt below.
How to Change Directory in CMD Windows 10
- Open elevated Command Prompt
- Use the CD command to change directory in CMD
How to Change Directory in CMD with CD Command
Before you use Command Prompt to change directory, you should enter into Command Prompt at first.
Step 2. How to Use CD Command in CMD to Change Directory
Then you can type CD command lines in CMD to change different directory or folder paths.
If you want to go to a specific directory, you can type cd + full directory path, e.g. cd C:Program Files.
To open a particular folder, you can type cd + full folder path, e.g., cd C:Program Filesoffice.
To go up a directory level you are currently working, you can type cd ..
To check the whole subdirectories and folders in the current directory, you can type dir command.
To go to the root level directory from any directory, you can type cd .
Bottom Line
Now you should know how to change directory in Command Prompt (CMD) by using CD command in Windows 10. You can easily access different directories or folders with CD command Windows in Command Prompt.
If you can’t find a file or folder in your Windows 10 computer, you may lost it or mistakenly deleted it, you can easily recover the file or folder with MiniTool Power Data Recovery.
MiniTool Power Data Recovery is a professional free data recovery program compatible with Windows 10/8/7. You can use this software to easily recover data from various data loss situations.
Namely, you can recover any deleted/lost files from Windows 10/8/7 computer, external hard drive, USB/thumb/pen drive, SD card, and more.
- MiniTool
- MiniTool News Center
How do I navigate to D drive in Command Prompt? Some of you may face the problem “can’t change directory to D drive with CD command in CMD”, check how to fix it in this post. FYI, if you are searching for free data recovery tool, hard drive partition manager, system backup and restore program, MiniTool software offers all.
Fix Can’t Navigate to D Drive with CD Command in CMD
Q1: I can’t get to the D drive when I type cd D: or even if I type cd D:older name. Then I type the command like this: chdir D: or cd d:, it still says I’m in the C:. I think I’m missing something simple. How to fix this?
Solution 1: Typing cd D:older name can allow you to access the specific folder under the current directory D drive. But if your current working drive and directory is C: drive, then this command can’t work. The simple solution to navigate to D drive is to type D: command in Command Prompt without CD command. Remember not to use the “” after the drive.
Solution 2: You can also use this command: cd /d d:. This command will change directory to whatever the current directory on D drive is, and also change the current drive to D drive.
Q2: How do I navigate to D drive in Command Prompt?
Q3: Command Prompt won’t change directory to another drive? I’m trying to change directory to a folder named Java in Command Prompt, but it doesn’t change the directory with either of these two command lines below, what am I missing?
A: You can only use CD command to move between directories within the same drive. If you want to access to a directory on another drive, you should add /d switch. The command line above should be cd /d d:DocsJava. If you type this command and hit Enter, it will change to the correct directory now.
Alternatively, you can also type the drive like d: in Command Prompt to switch to the target drive, and then use cd command like cd DocsJava to direct you to the directory you want.
Q4: How to go back to previous directory in Command Prompt?
A: In Linux, to navigate to the previous directory, you can type “cd -“. But in Windows, you can use the pushd and popd commands like the picture below.
Other tips for quickly changing directory in CMD.
- To navigate up one directory level, you can type “cd ..”.
- To go back to root directory, you can use “cd /”.
- To navigate to your home directory, you can type “cd” or “cd ~”.
Conclusion
This post helps you fix the “can’t navigate to D drive cd command” issue, and gives answers for how to navigate to previous directory, root directory, up one directory level with CMD.
If you want, you can change drive letter for a drive with CMD (Command Prompt) in Windows 10. This post includes detailed guides for how to use Diskpart command-line tool to change driver letter in CMD.
How to Change Drive Letter with CMD in Windows 10
Diskpart is a Windows built-in CMD tool that lets you easily manage hard drive and change drive letter. To change or assign drive letter in CMD, you can firstly open Diskpart utility in Command Prompt. Check the steps below.
Step 1. Open CMD in Windows 10
You can press Windows + R, type cmd, and press Ctrl + Shift + Enter to open elevated Command Prompt.
Step 2. Open Diskpart tool
In Command Prompt window, you can type diskpart command, and press Enter. This will open the Diskpart command-line utility.
Step 3. Change drive letter CMD
Next you can type the command line below to change drive letter in Command Prompt in Windows 10. Remember to press Enter after typing each command line.
- list volume (this command will list all available volumes detected by your computer)
- select volume * (replace “*” with the exact volume number of the target partition)
- assign letter=* (replace “*” with the preferred drive letter like “F”)
After you change or assign a drive letter for a drive or device, Windows will display the same letter automatically next time you reconnect the device to your computer.
If you want to remove the drive letter of a specific drive, you can type remove letter=* command and press Enter. Still, replace “*” with the exact drive letter of the target drive.
How to Change Drive Letter Using PowerShell
Step 2. Next type get-disk command and press Enter to list all available drives the computer detected.
Instead of using CMD or PowerShell to change drive letter for a drive in Windows 10, you can also utilize third-party free disk partition manager like MiniTool Partition Wizard to easily change drive letter and manage disk partitions on Windows 10.
MiniTool Partition Wizard let you easily create/delete/extend/resize/format/wipe partitions, convert partitions formats, migrate OS, clone disk, test hard drive speed, analyze hard drive space usage, check and fix disk errors, and more.
- Open start and type cmd. Right click Command Prompt and click .
- Type cd and enter your directory’s path. The path can be found by looking at the address at the top of the folder you are directing to.
- Press .
- Open Start. Either click the Windows logo in the bottom-left corner of the screen, or press the key.
For Windows 8, place your mouse cursor in the top-right corner of the screen, then click the magnifying glass icon when it appears. - For Windows 8, place your mouse cursor in the top-right corner of the screen, then click the magnifying glass icon when it appears.
- Type in cmd. This will bring up the Command Prompt icon at the top of the Start window.
- Right-click Command Prompt. It resembles a black box. This invokes a drop-down menu.
- Confirm this choice by clicking Yes when prompted.
- Type in cd . Make sure you include the space after “cd”. This command, which stands for “change directory”, is the root of any directory change.
Don’t press the key. - Don’t press the key.
- Determine your directory’s path. A directory path is like a map to a specific folder. For example, if the directory to which you want to change is the “System32” folder that’s in the “WINDOWS” folder on the hard drive, the path would be “C:WINDOWSSystem32”.
You can find a folder’s path by opening My Computer, double-clicking the hard drive icon, navigating to your destination, and then looking at the address at the top of the folder. - You can find a folder’s path by opening My Computer, double-clicking the hard drive icon, navigating to your destination, and then looking at the address at the top of the folder.
- Type in your directory’s path. Your command or address goes after the “cd” command; make sure there is a space between “cd” and your command.
For example, your whole command might look like cd WindowsSystem32 or cd D:.Since your computer’s default directory location will be the hard drive (e.g., “C:”), you don’t need to type in the hard drive’s name. - For example, your whole command might look like cd WindowsSystem32 or cd D:.
- Since your computer’s default directory location will be the hard drive (e.g., “C:”), you don’t need to type in the hard drive’s name.
- Press . Doing so will change the Command Prompt directory to your selected one.
Add New Question
- How do I change the name of a drive, like from Drive H: to drive A:?
In start, type Computer Management. Open Computer Management and click the arrow next to Storage, then Disk Management. Right-click the drive you want to rename and click Change Drive Letter. - What is the difference between cd and cd?
In order to use cd you have to put a file path after it; cd just goes straight to C:.
See more answers
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
- Changing the directory is useful when attempting to modify or delete a file in a specific location.
- D: or F: – Change the directory to the disk drive or an attached flash drive.
.. – Move the current directory up by one folder (e.g., “C:WindowsSystem32” to “C:Windows”).
/d – Changes the drive and the directory at the same time. For example, if Command Prompt is in the disk drive (“D:”), typing “cd /d C:Windows” would move you to the Windows directory on the hard drive (“C:”).
– Takes you to the root directory (e.g., the hard drive). - D: or F: – Change the directory to the disk drive or an attached flash drive.
- .. – Move the current directory up by one folder (e.g., “C:WindowsSystem32” to “C:Windows”).
- /d – Changes the drive and the directory at the same time. For example, if Command Prompt is in the disk drive (“D:”), typing “cd /d C:Windows” would move you to the Windows directory on the hard drive (“C:”).
- – Takes you to the root directory (e.g., the hard drive).
Thanks for submitting a tip for review!
About This Article
Did this summary help you?
Thanks to all authors for creating a page that has been read 2,448,656 times.
В этой статье рассказывается, как перейти в другую папку (каталог) в командной строке Windows. Чтобы работать с командной строкой, необходимо использовать учетную запись администратора.
- Откройте меню «Пуск». Для этого щелкните по логотипу Windows в нижнем левом углу экрана или нажмите клавишу на клавиатуре.
В Windows 8 переместите указатель мыши в верхний правый угол экрана и щелкните по отобразившемуся значку в виде лупы. - В Windows 8 переместите указатель мыши в верхний правый угол экрана и щелкните по отобразившемуся значку в виде лупы.
- В строке поиска введите командная строка. Значок утилиты командной строки отобразится над строкой поиска.
- Щелкните правой кнопкой мыши по значку командной строки. Он имеет вид черного квадрата. Откроется контекстное меню.
- Нажмте Запуск от имени администратора. Эта опции находится в верхней части раскрывшегося меню. Откроется командная строка с правами администратора.
В открывшемся окне с предложением подтвердить ваши действия нажмите «Да».Нельзя запустить командную строку от имени администратора, если вы работаете на компьютере, у которого есть ограничения, который находится в публичном месте или подключен к локальной сети (например, в библиотеке или в школе), то есть в том случае, когда вы пользуетесь гостевой учетной записью. - В открывшемся окне с предложением подтвердить ваши действия нажмите «Да».
- Нельзя запустить командную строку от имени администратора, если вы работаете на компьютере, у которого есть ограничения, который находится в публичном месте или подключен к локальной сети (например, в библиотеке или в школе), то есть в том случае, когда вы пользуетесь гостевой учетной записью.
- Введите cd . После «cd» обязательно добавьте пробел. Эта команда, которая представляет собой сокращение от «change directory» (изменить каталог), является основной командой для перехода в другой каталог.
Не нажимайте клавишу . - Не нажимайте клавишу .
- Определите путь к нужному каталогу. Путь к каталогу похож на перечень папок. Например, если нужным каталогом является папка «System32», которая находится в папке «WINDOWS» на системном диске, путь будет таким: «C:WINDOWSSystem32».
Чтобы выяснить путь к папке, откройте окно «Мой компьютер», дважды щелкните по значку жесткого диска, перейдите в нужную папку, а затем скопируйте информацию из адресной строки Проводника (сверху). - Чтобы выяснить путь к папке, откройте окно «Мой компьютер», дважды щелкните по значку жесткого диска, перейдите в нужную папку, а затем скопируйте информацию из адресной строки Проводника (сверху).
- Введите путь к каталогу. Сделайте это после команды «cd». Убедитесь, что между «cd» и путем к каталогу есть пробел.
Например, команда может выглядеть так: cd WindowsSystem32 или cd D:.По умолчанию местоположением всех папок считается жесткий диск (например, «C:»), поэтому букву жесткого диска вводить не нужно. - Например, команда может выглядеть так: cd WindowsSystem32 или cd D:.
- По умолчанию местоположением всех папок считается жесткий диск (например, «C:»), поэтому букву жесткого диска вводить не нужно.
- Нажмите . Так вы перейдете в нужный каталог.
Советы
- Изменить каталог необходимо, чтобы отредактировать или удалить файл.
- Некоторыми общими командами для работы с каталогами являются следующие:
D: или F: – изменить каталог на дисковод или подключенный флеш-накопитель.
.. – переместиться из текущего каталога на одну папку вверх (например, из «C:WindowsSystem32» в «C:Windows»).
/d – одновременно изменить диск и каталог. Например, если в командной строке вы находитесь в корневом каталоге диска «D:», введите «cd /d C:Windows», чтобы перейти в папку «Windows» на диске «C:».
– перейти в корневой каталог (например, системного диска). - D: или F: – изменить каталог на дисковод или подключенный флеш-накопитель.
- .. – переместиться из текущего каталога на одну папку вверх (например, из «C:WindowsSystem32» в «C:Windows»).
- /d – одновременно изменить диск и каталог. Например, если в командной строке вы находитесь в корневом каталоге диска «D:», введите «cd /d C:Windows», чтобы перейти в папку «Windows» на диске «C:».
- – перейти в корневой каталог (например, системного диска).
Предупреждения
Позволь представить нашего первого нового друга: командную строку!
Следующие шаги покажут как использовать черное окно, которым пользуются все хакеры. В начале оно может показаться немного пугающим, но, на самом деле это просто окно, которое ждет от тебя команды.
Примечание Пожалуйста, обратите внимание, что в этой книге мы используем термины «каталог» и «папка» взаимозаменяемо, эти слова обозначают одно и то же.
Что такое командная строка?
Окно, которое обычно называют командной строкой или интерфейсом командной строки (англ. CLI, Command Line Interface), является текстовым приложением для просмотра, обработки и манипулирования файлами на вашем компьютере. Как Проводник Windows или Finder на Mac, но без графического интерфейса. Другими названиями для командной строки являются: cmd, CLI, prompt, консоль или терминал.
Открываем интерфейс командной строки
Для того, чтобы начать экспериментировать, нам нужно сначала открыть интерфейс командной строки.
Теперь ты должна увидеть окно белого или черного цвета, которое ожидает команд.
Если ты используешь Mac или Linux, то, вероятно, увидишь символ $:
Каждую команду будет предварять этот знак и один пробел, но тебе не придется их вводить. Компьютер сделает это за нас 🙂
Твоя первая команда (УРА!)
Давай начнем с чего-то простого. Введи следующую команду:
И затем нажми enter. Вот наш результат:
$ whoami
olasitarska
Как видишь, компьютер только что напечатал твоё имя пользователя. Аккуратный, правда? 🙂
Попробуй набирать каждую команду самостоятельно, а не копировать и вставлять. Ты запомнишь больше таким образом!
Основы
В каждой операционной системе набор команд для командной строки немного отличается, поэтому не забывай следовать инструкциям для своей операционной системы. Давай попробуем, готова?
Текущий каталог
Было бы приятно знать, где мы находимся сейчас, верно? Давай посмотрим. Введи следующую команду и нажми enter:
Если ты в Windows:
Ты, вероятно, увидишь нечто похожее на своем компьютере. Когда ты открываешь командную строку, то обычно находишься в домашнем каталоге текущего пользователя.
Примечание: «pwd» означает «вернуть рабочий каталог» ‘print working directory’.
Список файлов и каталогов
Так что же в нем? Было бы здорово узнать. Давайте посмотрим:
Смена текущего каталога
Теперь вернемся в наш каталог рабочего стола:
$ cd Desktop
Проверь, что рабочий каталог действительно изменился:
Вот и он!
ПРО совет: Если ты введешь cd D и затем нажмешь Tab на клавиатуре, в командной строке будет автоматически набрана остальная часть имени, что позволит быстрее перемещаться по каталогам. Если существует более одной папки, название которой начинается с «D», нажми Tab дважды, чтобы получить список вариантов.
Создание каталога
Как насчет создания каталога practice на рабочем столе? Вы можете сделать это таким образом:
$ mkdir practice
Эта маленькая команда создаст папку с именем practice на рабочем столе. Ты можешь проверить, появилась ли она, просто взглянув на рабочий стол или введя команду ls / dir! Попробуй 🙂
ПРО совет: Если ты не хочешь вводить одни и те же команды снова и снова, попробуйте нажать на стрелку вверх и стрелку вниз на клавиатуре, чтобы просмотреть недавно использованные команды.
Тренеруемся!
Небольшая задачка: в недавно созданной папке practice создай папку с названием test. Используй команды cd и mkdir.
Решение
$ cd practice
$ mkdir test
$ ls
test
Чистка
Мы не хотим оставлять беспорядок, поэтому давай удалим все, что мы создали до этого момента.
Во-первых, мы должны вернуться на рабочий стол:
$ cd ..
Используя .. с командой cd ты можешь сменить текущий каталог на родительский (то есть каталог, содержащий в себе текущий).
Проверь, где ты находишься:
Пришло время удалить каталог practice:
Внимание: удаление файлов с помощью del, rmdir или rm безвозвратно, это означает, что удаленные файлы будут потеряны навсегда! Поэтому будь очень осторожна с этими командами.
$ rm -r practice
Готово! Давай проверим, что папка действительно удалена:
Выход
Вот и все на данный момент! Теперь можно безопасно закрыть командную строку. Давай сделаем это как хакеры, согласна? 🙂
Краткий обзор
Вот краткий обзор некоторых полезных команд:
Это лишь некоторые из команд, которые можно использовать в командной строке, но сегодня тебе больше и не пригодится.
Если тебе интересно, ss64.com содержит полный справочник команд для всех операционных систем.
Готова?
Давай погрузимся в мир Python!
What is a command prompt?
There are various ways to open command prompt. A common one in Windows is to use the command prompt shortcut located in the Start menu or on the Apps screen.
The basic command level might look like this:
The OS is now ready for a command. Each command launches a batch file that initiates a specific function. The change directory function looks like this:
This changes the directory to:
The OS executes the chkdsk utility for the applications directory and presents a summary of the components in that directory, such as the number of files and subdirectories, and number of bytes in use and the number available.
The syntax of the wording entered on the command-line is important. The system will not execute a function if a letter or number is in the wrong sequence.
Examples of commands
- Cls to clear the command prompt screen;
- Copy to create a copy of something such as a file;
- Del to delete a file;
- Format to formats a disk according to specific requirements;
- Ipconfig to list the network data such as IP address and subnet mask;
- Ping to send a packet to an IP address and display the information returned from the other device;
- Sfc to detect and fix corrupt system files; and
- Shutdown to execute a system shutdown or restart.
PowerShell is an advanced version of the Windows command prompt. It provides additional functionality to the command prompt.
https://youtube.com/watch?v=rtyXJC6RdpA%3Fautoplay%3D0%26modestbranding%3D1%26rel%3D0%26widget_referrer%3Dhttps%3A
The Windows command prompt and PowerShell can do similar things. Find out when to use command prompt and PowerShell with these examples.
Continue Reading About command prompt
rm /s name_of_directory_you_want_to_delete
Useful tips
- The command Ipconfig shows your computer’s ip address
- If you type part of a directory’s name and hit the tab key the command prompt will autocomplete it and if you hit the tab key repeatedly it will cycle through directories that start with the same letter
- You can use other shells or tools such as git bash or cmder to add more commands and functionality to your command prompt
- If you know the path to a file or directory can type cd PATH_TO_YOUR_DIRECTORY instead of changing directories several times to get to a directory or file
- When you hit the up arrow key your previously entered command will appear and if you hit it repeatedly it will cycle through all of your previously entered commands
Learn to code for free. freeCodeCamp’s open source curriculum has helped more than 40,000 people get jobs as developers. Get started
There’s a lot to learn when you’re getting into tech. But fortunately there are some skills that you can use across different programming languages, operating systems, and tools.
And knowing how to use the command line interface (also known as the command prompt or terminal, depending on your operating system) is one of those skills.
Whether you’re doing Web development, Game Development, Application Development, Cloud Engineering, DevOps, or many other disciplines in tech, you’ll likely use the command line quite often.
History of the Command Line
In the early days of computers, developers used MS-DOS to navigate around the computer system.
Disk Operating System (DOS) is a kind of operating system that uses commands (words) to interact with the computer.
For instance, to go to a particular folder, you’d type:
The command line interface (or CLI for short) is similar to DOS in that it uses commands to perform various operations, like creating files, creating folders, installing programs, and what have you.
What is the CLI? Is it a Programming Language?
If you’re new to software development, it’s easy to get carried away with the various terminology you’ll need to learn. Worry less, you are not doing a spelling bee competition. Rather, you are meant to learn what these terms refer to, how they actually work, and how you can use them.
One of the terms you’ll hear quite often is the Command Line Interface (also referred to as Command Prompt or Terminal).
The Command Line Interface (CLI) is an editing environment that is text-based. It uses specified text (known as commands) to interact with the computer and perform numerous operations, including installing and working with programs.
Every operating system comes with an inbuilt command prompt. Some application packages such as Nodejs, Anaconda, Git, and so on also come with their own command prompt.
The same thing goes for Cloud Providers such as AWS, GCP, Azure. Although the CLI bears different names across different platforms or packages, its purpose remains the same: to let you interact freely with the software package or the computer system using text-based instructions known as commands.
So, the CLI is a tool, not a programming language.
A basic knowledge of CLI will help you along your tech journey, especially if you are into Software Development. In fact, you can completely build a program and run it right from the CLI.
This article will:
- Explain how the CLI Works
- Help you locate your CLI according to your OS
- Show you how to perform basic operations using the CLI
- Help you differentiate between the CLI and GUI
How the CLI Works
To use your CLI:
- Locate the CLI in your PC
- Open it
- Type in your desired commands
- Press the enter key
Later in the tutorial, we’ll execute some commands using the CLI so you can better understand how it works.
The Command Line in Different Operating Systems
Every Operating System comes with its default Command Line Interface, though you can choose to install a more advanced CLI depending on your needs.
Some Operating Systems and their respective CLIs are listed below:
- Windows: Command Prompt
- Linux: Linux Bash Shell
- MacOs: Mac Terminal
- Google Cloud Platform: PowerShell, Cloud shell
- Amazon Web Services: AWS Command Prompt
- Microsoft Azure: Azure CLI bash
A picture of Windows command prompt, AWS Cloudshell, MacOs Terminal and Linux Terminal
I currently use Windows OS and Windows Command Prompt, but I’ll also show you how you can locate your own Terminal or Command Prompt based on popular Operating systems.
How to Locate your CLI
You can access the command prompt in Windows OS using the program directory or using shortcut keys.
Using the program directory, go to your search bar (next to the Windows icon) and type cmd. This will pop up a list of all the command prompts available on your machine, including the default windows cmd. You can now select the one you wish.
Using a keyboard shortcut, press Windows + R on your keyboard and type in cmd on the dialog box that pops up.
A picture showing the run terminal
In MacOS
As in the case of Windows, you can also open the CLI in a Mac OS using the program directory or a keyboard shortcut.
To use the program directory, locate the launchpad and type in Terminal. This will bring it up.
To use the keyboard shortcut, type the combination of the cmd + space bar keys.
Here’s how to locate MacOs Terminal and create a file in a directory:
How to Perform Basic Operations Using the CLI
Back in Mathematics class, it was quite easy to memorize formulas and solve equations using those memorized formulas. But knowing when to apply those equations in real life scenarios was – and often continues to be – difficult for many students.
Knowing where your CLI is located and how it works is a good step in the right direction. But let me show you how to get started with the CLI by practicing simple operations right from your Command Prompt.
How to navigate through your PC with the CLI
Navigating through your PC simply means moving from one folder or file to another. If you don’t want to use your mouse to direct your cursor, you can move around your PC using the CLI.
- Open the CLI (CMD) as explained earlier
- Next, type in cd Desktop on the command prompt which will take you to your desktop
Keep in mind that this command is for Windows OS (for Mac, for example, it’ll be slightly different).
Here’s what you’ll see:
How to create a folder using the CLI
You may know the usual method of right-clicking on your screen and selecting the “New folder” option on the drop-down menu. But there’s a way of creating a new folder using the CLI.
- First, open your CLI
- Navigate to the folder or location where you want to create the new folder
- Press Enter
How to install a package using the CLI
Installing a software package or application using the CLI depends on the package in question.
Packages like Node.js (a development package for BackEnd Development) require that you install the Node Package Manager (npm). This package manager is what you’ll use to install and run Node and other similar packages.
Some commands for installing software packages via the CLI include:
For instance to install a new instance of a React app:
- Open the terminal
- locate your local environment by typing:
cd Desktop mkdir my_directory
npx create-react-app my-app
A terminal showing the commands for installing create-react-app using Windows Command Prompt
Differences Between the CLI and GUI
GUI vs CLI image
As we’ve discussed, the CLI uses commands to generally interact with the computer.
Unlike the GUI, the CLI uses less RAM space and interacts with the operating system directly.
To use the GUI, no programming knowledge is required. But to use the CLI, you need to have a certain amount of knowledge of programming and command operations.
As you begin or advance in your tech journey, you’d need to install a lot of programs that are foreign to your Local Machine. Such programs may not have GUI installation methods and may require you to run a line of code or more on your CLI. At such a point, knowledge of using the CLI comes in handy.
There’s a general notion that the CLI is difficult to use – and it does take some getting used to. But once you get acquainted with the operations of CLI you’ll find it much easier to manage.
N.B.: You have to be careful while using the commands I’ll show you. This is because some commands can have a lasting negative or positive effect on your Windows PC until you reset it.
Powershell start cmd -v runAs – Run the Command Prompt as an Administrator
It is important to have access to all drivers because they often cause problems.
That’s what this command does – it shows you even the drivers you won’t find in the device manager.
Chdir or cd – Changes the Current Working Directory to the Specified Directory
If you want to see more detailed information about your system you won’t see in the GUI, this is the command for you.
Set – Shows your PC’s Environment Variables
You can use the prompt command to change that default text with the syntax prompt prompt_name $G:
N.B: If you don’t append $G to the command, you won’t get the greater than symbol in front of the text.
Clip – Copies an Item to the Clipboard
You can type clip /? and hit ENTER to see how to use it.
Assoc – Lists Programs and the Extensions They are Associated With
If you are a programmer or writer and you want to quickly see what differs between two files, you can enter this command and then the full path to the two files. For example fc “file-1-path” “file-2-path”.
Cipher – Wipes Free Space and Encrypts Data
You can use the cipher command to wipe the drive clean and encrypt such files.
Netstat -an – Shows Open Ports, their IP Addresses and States
Enter color attr to see the colors you can change to:
Entering color 2 changes the color of the terminal to green:
” %i in (‘netsh wlan show profiles’) do @echo %j | findstr -i -v echo | netsh wlan show profiles %j key=clear – Shows All Wi-Fi Passwords
This command also has extensions such as ipconfig /release, ipconfig /renew, and ipconfig /flushdns which you can use to troubleshoot issues with internet connections.
Sfc – System File Checker
This command scans your computer for corrupt files and repairs them. The extension of the command you can use to run a scan is /scannow.
Powercfg – Controls Configurable Power Settings
You can use this command with its several extensions to show information about the power state of your PC.
You can enter powercfg help to show those extensions.
For example, you can use powercfg /energy to generate a battery health report.
The powercfg /energy command will generate an HTML file containing the report. You can find the HTML file in C:Windowssystem32energy-report.html.
Dir – Lists Items in a Directory
You can hide a folder right from the command line by typing in attrib +h +s +r folder_name and then pressing ENTER.
To show the folder again, execute the command – attrib -h -s -r folder_name.
Start website-address – Logs on to a Website from the Command Line
You can do the same thing you do with the task manager with this command:
The next command shows you how to close an open task.
Taskkill – Terminates a Running Task
To kill a task, run taskkill /IM “task.exe” /F. For example, taskkill /IM “chrome.exe” /F:
Date – Shows and Changes the Current Date
For example, powercfg -help shows how to use the powercfg command
Echo – Shows Custom Messages or Messages from a Script or File
N.B.: The folder must be empty for this command to work.
More – Shows More Information or the Content of a File
In case you enter several commands and the command line gets clogged up, you can use cls to clear all entries and their outputs.
Exit – Closes the Command Line
You can shut down, restart, hibernate, and sleep your PC from the command line.
Enter shutdown in the command line so you can see the extensions you can use to perform the actions. For example, shutdown /r will restart your computer.
This article showed you several “unknown-to-many” commands you can use to get access to hidden functionalities on your Windows PC.
Again, you should be careful while working with these commands because they can have a lasting effect on your OS.
However, it’s a good idea to become familiar with command line basics in Windows. It helps you appreciate the OS more and can come in handy for some tasks. Here’s a beginner’s guide to the Windows Command Prompt for those who aren’t yet familiar.
What Is the Command Prompt?
The Command Prompt, officially called the Windows Command Processor and often abbreviated to CMD, is the command line interface for Windows operating systems. A command line interface is a way of interacting with a computer directly using text commands.
Early versions of Windows, like Windows 3.1, effectively ran as a visual interface on top of DOS. Later versions, including Windows 95 through Windows ME, also included MS-DOS integration. These allowed you to run commands through the MS-DOS Prompt, as the Command Prompt was called at the time.
Starting with Windows XP, Windows broke away from MS-DOS. However, in modern versions of Windows, you can still use the Command Prompt to interface with your computer directly instead of clicking through various menus. The Command Prompt can also run batch files; these make automating tasks easy.
How to Open the Command Prompt in Windows 10 and Windows 11
There are a few ways to open the Command Prompt in Windows. Below are the most convenient:
- Type “command prompt” into the Start menu to search for it. You can also type “cmd” (the short name of the executable that runs the Command Prompt) if you prefer.
- Press Win + R to open the Run box, then type “cmd” and hit Enter to open it.
- Press Win + X (or right-click the Start button) and choose Command Prompt from the menu. Depending on your Windows settings, this may show Windows PowerShell or Windows Terminal instead. The new Windows Terminal and PowerShell are both more powerful than the Command Prompt, but are backward-compatible with all CMD commands.
- Depending on your Windows settings, this may show Windows PowerShell or Windows Terminal instead. The new Windows Terminal and PowerShell are both more powerful than the Command Prompt, but are backward-compatible with all CMD commands.
How to Use the Windows Command Prompt
When you open a Command Prompt window, you’ll see some basic info about your current Windows version. Below this, you’ll see a line like the below:
This is your current location. Any commands you run that rely on location (such as deleting files) will take place in this folder. Other CMD commands are more general and don’t rely on you being in a specific location.
It’s important to know that when working in the Command Prompt, you must type commands exactly as the system expects. Since you’re issuing commands directly to your computer, it won’t understand if you type something wrong.
This isn’t a problem; what’s more of a risk is accidentally typing the wrong command, or using a command in a way you didn’t intend. For example, when trying to delete one file, you might accidentally tell it to delete an entire folder instead.
Basic Command Prompt Commands for Beginners
There are lots of Command Prompt commands, and most of them aren’t intuitive for newcomers. Learning them takes some time, so it’s best to pick up a few at a time and slowly build your knowledge.
Let’s look at a handful of CMD commands that illustrate its use for a beginner. These are just a very small sampling of what the Command Prompt can do, however. When you’re ready to move on, have a look at more CMD commands you should know, as well as our cheat sheet of handy Windows commands.
Getting Help
Typing help will list many common commands that you can use. These will get you started, so you don’t have to go looking for command names on your own.
Listing and Changing Directories
The dir command, which is short for directory, will list the contents of the folder that you’re currently in. As mentioned earlier, you can check this by looking at the folder that appears to the left of your current command.
Creating and Deleting Files and Folders
If there’s too much clutter on the Command Prompt’s screen, type cls to clear the contents and start fresh. And if there’s a command running that you want to cancel (maybe it’s taking too long), hit Ctrl + C to end it.
Networking Commands
Some of the most useful Command Prompt commands deal with networking. Commands like ping let you see if your computer can reach a remote destination and how long it takes. Meanwhile, ipconfig lets you see the network overview for your current connection.
Learning about CMD commands for managing networks is thus a great use of the tool.
Commands for Troubleshooting
Now you’re familiar with the basics of the Command Prompt, even if you’ve never used it before. Some tasks, like managing files and folders, will probably feel clunky in the command line if you’re used to doing these with the GUI. But for other tasks, like checking your IP address, running a quick CMD command is much more convenient than clicking through a bunch of menus.
While most CMD commands are specific to the Windows environment, Windows 10 and later also allow you to run the Bash shell used by Linux, macOS, and many other OSes. This is worth learning about if you use multiple platforms.
The Command Prompt is a Windows utility that lets you give the system instructions. It can automate tasks, troubleshoot issues, and perform all sorts of functions. We’re going to show you how to get the most out of it, including changing the colors, executing multiple commands, getting help on any command, and much more.
To open the Command Prompt, type cmd in the Start menu search bar and select the Best Match. Alternatively, press Windows key + R, type cmd into the Run utility, and press Enter to launch the Command Prompt.
How to Always Open Command Prompt as Administrator
- Type cmd in the Start menu search bar.
- Right-click the Best Match and click Open file location.
- Right-click the Command Prompt shortcut and click Properties.
- On the Shortcut tab, click Advanced.
It can also list the Command Prompt, but yours might have Windows PowerShell instead.
- Press Windows key + I to open Settings.
- Slide Replace Command Prompt with Windows PowerShell in the menu when I right-click the start button or press Windows logo key + X to Off.
How to Open Command Prompt via the Folder Context Menu
Sometimes, you want to run a Command Prompt string from a specific folder. Rather than manually do that, you can edit the registry so that when you press Shift and right-click inside a folder, you get the option to Open command window here.
To apply this change, head to TenForums and download its registry tweak.
How to Copy and Paste in Command Prompt
To paste text into the Command Prompt, press Ctrl + V, the same as you would in most other applications.
Copying works a bit differently. First, press Ctrl + M to enter Mark mode. Left-click and drag to highlight the text you need, then press Ctrl + C or Enter to copy it to your clipboard.
Think that sounds too cumbersome? Right-click the Command Prompt title bar and click Properties. Switch to the Options tab, tick Quick Edit Mode, and click OK. Now you don’t need to press anything before being able to highlight text.
Use Arrows Keys for Previous Commands
If you’ve entered a previous command that you want to use again, use the up and down arrows on your keyboard to move between them. This is handy if you’re repeatedly executing the same commands or want to correct a mistake in what you just submitted.
You can also press the right arrow key to enter your previous command character by character. This could be useful if you need to enter multiple commands that have the same opening.
Alternatively, press F7 to see a list of all your previous inputs, using the up and down arrows to navigate and Enter to select, or type doskey /history to output it in the Command Prompt.
Drag and Drop Files for Input in Command Prompt
It can be tedious to write out a folder or file path name in the Command Prompt. You don’t need to waste time, though, because there’s a much quicker way.
Navigate to the folder or file you want in File Explorer. Left-click and drag it into a Command Prompt window. That path will then appear. It’s that simple!
How to Get Help With Any Command
Is there a command that you can’t quite remember how to use or what it does? No problem. Just append /? to your command, and you’ll be shown information about that command, like what options you can use and some examples. It works on all of them.
For example, if you want more information about the ipconfig command, then input ipconfig /?. It won’t actually run the command, so don’t worry about that.
Use Tab to Auto-Complete Commands
You can press the Tab key to auto-complete your command. This is useful when you don’t know the full name of the command or save you time. For example, you can press Tab to automatically complete it rather than typing out a full file path.
If what it serves isn’t what you need, just keep pressing Tab to progress through the options. Alternatively, press Shift + Tab to reverse through the options.
How to Output to a File or Clipboard on Command Prompt
If you want to save the output of the Command Prompt, then you could copy it, paste it into a text editor, and then save. But there’s a quicker method, all within Command Prompt.
How to Cancel a Command
If you’ve submitted a command that you want to stop, just press Ctrl + C. This will end the command up to the point that it’d processed. It won’t reverse what has already been done, but it will stop it from going any further.
You’ll find a lot of commands will complete before you even have time to press the keys, but it’s useful for those that do without having to exit Command Prompt completely.
How to Execute Multiple Commands
If there are multiple commands you want to use, you don’t need to input each in turn and wait for them to complete. Instead, you can separate your commands with &&.
For example, if you wanted to output both ipconfig and tree, you would input ipconfig && tree. You can do this for however many commands you need. It’s not just limited to two.
How to Customize the Look of Command Prompt
The default black and white appearance of the Command Prompt is iconic, but it doesn’t hurt to mix things up a bit. To begin customizing the look, right-click the title bar of Command Prompt and click Properties.
Begin with the Font tab. Here you can change the Size and Font used. It’s recommended to use a TrueType font (signified with a TT symbol) for clearer display.
Move to the Layout tab. Here you can change the size and position of the Command Prompt window. In actuality, it’s easier just to do this on the window itself: drag the sides of the window to resize and drag on the title bar to move the window.
Finally, go to the Colors tab. As you might expect, here, you can change the color of many Command Prompt elements. Use the radio buttons to select what you want to recolor, then click a color to set it. Alternatively, input the red, green, and blue values. The Opacity slider will adjust the entirety of the Command Prompt window. Set it to 100% if you don’t want any opacity.
Learn Some New Commands
Hopefully, you’ve learned something new about how to get the most from the Command Prompt. Whether it’s something to make you more efficient, like outputting to a file or auto-completing a command, or just something fun, like changing the colors, there’s so much the Command Prompt can do.
The Command Prompt and Powershell are handy tools for executing advanced processes, and there are many ways to open either.
Similarly, PowerShell is also a command-line interpreter that helps you manage and automate tasks. In most cases, you can use the Command Prompt and PowerShell to perform the same tasks.
If you’re wondering how you can open these tools, we’ll help you out. This article covers the nine ways to open the Command Prompt and PowerShell.
The Quick Access menu offers an incredibly easy way for opening various Windows features. To access the Command Prompt or PowerShell using this tool, here’s what you can do:
100+ Essential Windows CMD Commands
Need a quick way to open Windows apps? Then try the Start Menu search bar.
Here’s how you can open the Command Prompt or PowerShell using the search bar:
- Click the Start Menu search bar icon and type either Command Prompt or PowerShell.
- Select the Best match option from the results.
Use the Run Command Dialog Box
The Run command dialog box is one of the best tools you can use to quickly access your Windows apps.
Here’s how you can open the Command Prompt via the Run command dialog box:
- Press Win + R to open the Run command dialog box.
- Type CMD and click OK to open the Command Prompt.
To open PowerShell using the Run Command dialog box, here’s what you can do:
- Press Win + R to open the Run command dialog box.
- Type PowerShell and then click OK.
- Open the Run command dialog box as per the previous steps.
- Type either CMD or PowerShell in the search box.
You can access most Windows software programs using the Start menu search bar. To access either the Command Prompt or PowerShell with this tool, here’s what you can do:
- Click the Windows icon on your screen or press the Windows key.
- Select All Programs and expand the System Tools folder.