To run a program or command in the Command Prompt (cmd) on Windows, simply type the command and press Enter. Here’s a code snippet to illustrate running the `ping` command to test connectivity to a website:
ping www.example.com
Understanding CMD
What is CMD?
CMD, or Command Prompt, is a command-line interpreter application available in Windows Operating Systems. It provides a text-based interface for users to execute commands, perform troubleshooting tasks, and manage system operations efficiently. CMD allows users to execute a wide variety of tasks that would typically require a graphical interface, making it an invaluable tool for tech-savvy individuals and IT professionals alike.
Basic Structure of a CMD Command
To communicate correctly with CMD, it’s essential to understand the basic command structure:
- <command>: This is the main command you wish to execute.
- <arguments>: These additional specifications modify how the command behaves.
For example, consider the `dir` command, which lists the contents of a directory:
dir
You can also add an argument to filter results, such as the path of the directory:
dir C:\Users
How to Run a Cmd Command: A Quick Guide
Getting Started with CMD
Accessing CMD in Windows
Opening the Command Prompt is straightforward. Here are several methods:
- Using the Run dialog: Press `Windows + R`, type `cmd`, and hit `Enter`.
- Using the Start menu: Click on the Start menu, type `cmd` in the search bar, and press `Enter`.
- Keyboard shortcut: Press `Windows key`, type `cmd`, and press `Ctrl + Shift + Enter` to open as administrator.
Command Prompt vs. PowerShell
While both CMD and PowerShell provide text-based interfaces for command execution, they are fundamentally different tools. CMD is primarily designed for executing simple commands and scripts, while PowerShell offers extensive scripting capabilities and more complex functions, making it better suited for automation and task management. Choose CMD for quick commands and PowerShell for advanced scripting tasks.
How to Run Cmd.exe: A Quick Guide to Command Line Mastery
Basic Commands for Beginners
When starting with CMD, familiarity with basic commands can significantly enhance your command-line experience:
- `dir`: This command displays the list of files and folders in the current directory.
dir
- `cd`: This command allows you to change directories. To navigate to a folder named «Documents», use:
cd Documents
- `cls`: This command clears the screen, giving you a fresh workspace in CMD.
cls
Executing Commands with Parameters
Using parameters allows you to customize commands further. A common example is the `ping` command, which tests network connectivity. By adding parameters, you can fine-tune its behavior:
ping google.com -t
In this case, `-t` tells the command to continue pinging until you manually stop it (typically with `Ctrl + C`).
Running Batch Files
What is a Batch File?
A batch file is a script file that contains a series of commands to be executed by the command interpreter. It’s a handy way to automate repeated tasks or execute multiple commands in sequence.
How to Execute a Batch File in CMD
To run a batch file, navigate to the directory where it is stored and type its name. For example, if you have a file named `my_script.bat`, you would run:
my_script.bat
How to Run Cmd Prompt: A Quick Start Guide
Advanced CMD Usage
Running Multiple Commands
CMD allows you to run multiple commands in one line. This can save time and streamline workflows. You can use the `&&` operator to execute another command only if the first command was successful.
mkdir new_folder && cd new_folder
This creates a new folder named «new_folder» and, if successful, immediately changes the directory to it.
Redirecting Output
Output redirection is useful for saving command results to a file. You can use:
- `>`: To overwrite a file with new command output.
- `>>`: To append the output to an existing file.
- `2>`: To redirect error messages.
For example, to redirect the output of the `dir` command to a file named `output.txt`, you would do:
dir > output.txt
Running Commands with Administrator Privileges
Some commands require elevated permissions to execute. To run CMD as an administrator, follow these steps:
- Search for `cmd` in the Start menu.
- Right-click on Command Prompt and select Run as administrator.
Once you have CMD open with administrative privileges, you can run system-level commands, such as `chkdsk`:
chkdsk C: /f
This command checks the C: drive for file system errors and attempts to fix them.
How to Run Cmd File: A Straightforward Guide
Common Errors and Troubleshooting
Common CMD Errors
As you become familiar with executing commands, you may encounter certain errors. Here are some common ones:
- ‘command is not recognized’: Usually indicates a typo, a missing command, or that the command is not installed.
- ‘access denied’: Means you need higher privileges to execute that command.
How to Troubleshoot CMD Commands
When troubleshooting, always ensure the command syntax is correct, and double-check for typos. Utilizing `help` can also provide valuable insights into command usage.
help dir
This command provides detailed information about how to use the `dir` command effectively.
How to Ping on Cmd: A Quick Guide to Testing Connections
Conclusion
Mastering how to run in CMD is an essential skill for anyone looking to enhance their efficiency with Windows. By understanding basic and advanced commands, navigating the command line becomes intuitive. With consistent practice and exploration, users can unlock a more powerful aspect of their operating systems.
How to List Files in Cmd Like a Pro
Additional Resources
Links to Further Learning
For continued education, consider exploring online forums, tutorial videos, and books dedicated to CMD and command-line interfaces.
Join Our Community
For ongoing support and to connect with fellow CMD enthusiasts, look for forums or social media groups dedicated to CMD and Windows command line tips.
Last Updated :
22 Apr, 2025
Learn how to manually run the Command Prompt in different versions of Windows — The Windows Command Prompt (CMD) is a powerful tool that allows users to execute commands, automate tasks, and troubleshoot system issues efficiently. Whether you’re a beginner looking to learn basic CMD commands or an advanced user wanting to optimize your workflow, mastering the Windows Command Line Interface (CLI) can significantly enhance your computing experience.
In this step-by-step Windows Command Prompt tutorial, we’ll cover everything from basic commands like cd, dir, and mkdir to advanced functions such as network troubleshooting, batch scripting, and system management. Learning CMD can help you navigate Windows faster, execute tasks more efficiently, and fix errors that may not be solvable via the graphical interface.
Follow this tutorial to unlock the full potential of Windows Command Prompt and take control of your system like a pro.
What is a Command Prompt?
The Command Prompt is a powerful tool for troubleshooting Windows and managing files. It provides a text-based interface where users can execute various system commands and configure their computer. The Command Prompt is for all levels of users who are looking to perform advanced Command Prompt techniques, CMD also opens a broad range of capabilities, from automating tasks to system diagnostics.
- What is a Command Prompt?
Getting Started with Command Prompt
Learn how to open the Windows Command Prompt and understand its basic functions. This foundational knwoledge is seesntial for navigating your system using simple command-line.
- How to Open Command Prompt in Windows 11, 10, 8, 7
- How to Open Command Prompt as Administrator?
- How to Open Command Prompt with Keyboard Shortcuts
Basic Command Prompt List
Master the essential CMD commands to manmage directories, list files and clear the screen. These commands are fundamental for effective system navigation.
- cd
- dir
- cls
Also read 39 Windows CMD Commands for Everyone
System Information
Utilize systeminfo and ipconfig commands to retrieve detailed information about your system’s configuration, including network settings and hardware specifications. This is crucial for troubleshooting and system optimization.
- System Info
- ipconfig
- ping
- tasklist
File and Directory
In this section, you’ll get to know how to list all files in directories, search files using CMD, and will also allow you to create, manage and delete files and folders.
- List all Files in a Directory
- Search files
- mkdir
- Rename (files and folders)
- del
- Hide
- Compress (files and folders)
- copy
- Xcopy
- move
Networking and Connectivity
Diagnose and configure network settings with netstat, ping and tracert commands. These tools help you to test network connections, check network routes, and troubleshoot connectivity issues in your Windows system.
- netstat
- Check Open Ports
- tracert
- ftp
- Telnet
- nslookup
System Utilities
Maintain and repair system files using sfc and chkdsk commands. These built-in prompts are essential to ensure that you can make the most out of it.
- Difference Between SFC, CHKDSK, and DISM
- Chkdsk
- Repair
- sfc
- Diskpart
Advanced Commands
In this section, you’ll get to know some of the advanced CMD commands and functionality to automate your system tasks so that you can manage and perform any complex tasks with ease.
- Powershell
- Abort Command Execution
- Regedit
- Shutdown
- CMD Commands to Gather Information of a System
Customization
Personalize your Command Prompt experience by changing its font, text, creating batch file, Wi-Fi Hotspot, and Install program. These commands will enhance and make your experience seamless.
- Color cmd command
- Change text colour
- How to Clear the Windows Command Prompt Screen
- Setting up custom batch file
- Create a Wi-Fi Hotspot
- Merge/Hide One File into Another
- Copy files from one Directory to another
- Personalize Environment
- Hide text behind text
- Install Program
- Install Chocolatey
- Install Specific Version using Chocolatey
- Uninstall Software
Common Troubleshooting
You can use CMD troubleshooting commands like bootrec, bcdedit and sfc to diagnose and fix boot issues, repair corrupt files, and resolve system errors.
- Scannow
- Bootrec
- Bcdedit
- Remove Virus
- Show Previously Connected Wi-Fi Devices
- How to Repair Windows Common Errors Only With CMD
Command Prompt Tips and Shortcuts
Enhance your productivity with CMD Keyboard Shortcuts such as Ctrl + C (to stop process), Ctrl + Z (undo), or F7 to check the command history. These shortcuts enahnce users to navigate moe efficiently.
- Keyboard shortcuts
- Change and Customize Keyboard Shortcuts
- Command Prompt Hacks
- Useful CMD Commands for Daily Usage
- 26 Useful CMD Commands for Everyone
- Remotely Start Windows
- How to Run an exe through CMD
Command Prompt Real-Life Use Cases
In this section, you’ll get to know about how CMD commands can work as a charm in real-life scenarios. Whether you are looking to automate any task, or schedule it for later, you can do it all by just using the Windows Command Prompt.
- Automate tasks using CMD
- Change Windows Password
- Manage Network configuration
- Basic Scripting with batch files
Загрузить PDF
Загрузить PDF
Из данной статьи вы узнаете, как на компьютере с Windows запустить программу из командной строки. Запустить можно программу, которая хранится в папке, созданной Windows (например, на рабочем столе). Также папку с программой можно добавить в список командной строки, чтобы запустить эту программу из командной строки.
-
Щелкните по логотипу Windows в нижнем левом углу экрана. Или нажмите клавишу ⊞ Win на клавиатуре.
- В Windows 8 передвиньте указатель мыши в верхний правый угол экрана, а затем щелкните по значку в виде лупы.
-
Отобразится значок командной строки.
-
Он находится в верхней части меню «Пуск». Откроется окно командной строки.
- Если вы вошли в систему в качестве гостя, окно командной строки не откроется.
-
После команды start обязательно поставьте пробел.
-
Имеется в виду системное имя программы, а не имя ее ярлыка (например, системное имя командной строки: cmd). Ниже приведены системные имена основных программ:
- Проводник: explorer
- Блокнот: notepad
- Таблица символов: charmap
- Paint: mspaint
- Командная строка (новое окно): cmd
- Windows Media Player: wmplayer
- Диспетчер задач: taskmgr
-
Введенная команда должна выглядеть примерно так: start имя_программы. Указанная программа будет запущена в течение нескольких секунд после исполнения команды «start».
- Если выбранная программа не запустилась, скорее всего, она не включена в список программ командной строки. В этом случае перейдите к следующему разделу.
Реклама
-
Щелкните по логотипу Windows в нижнем левом углу экрана. Или нажмите клавишу ⊞ Win на клавиатуре.
-
Для этого щелкните по значку в виде папки в нижней левой части окна «Пуск».
-
Перейдите в папку с файлами программы, которую нужно открыть.
- Когда значок программы, которую необходимо запустить с помощью командной строки, отобразится в окне Проводника, значит, вы — в нужной папке.
- Если вы не знаете, где находится программа, поищите ее в папке «Program Files» на жестком диске или воспользуйтесь строкой поиска (сверху).
-
Щелкните по правой стороне адресной строки, которая находится в верхней части окна Проводника. Содержимое адресной строки будет выделено синим маркером.
-
Для этого нажмите Ctrl+C.
-
Эта папка находится в левой части окна Проводника.
-
Так будет отменено выделение любой папки внутри папки «Этот ПК», что позволит открыть свойства папки «Этот ПК».
-
Это вкладка находится в верхней левой части страницы. Откроется панель инструментов.
-
Значок этой кнопки имеет вид белого квадрата с красной галочкой. Откроется всплывающее окно.
-
Эта ссылка находится в верхней левой части окна. Откроется другое всплывающее окно.
-
Она находится в верхней части окна.
-
Эта опция находится в нижней части окна. Откроется другое окно.
-
Эта опция находится в окне «Системные переменные» в нижней части страницы.
-
Эта опция находится в нижней части страницы.
-
Эта опция находится в верхней правой части страницы «Изменить».
-
Для этого нажмите Ctrl+V.
-
Вставленный путь будет сохранен.
-
-
Введите cd в командной строке, затем поставьте пробел, нажмите Ctrl+V, чтобы ввести путь к программе, а потом нажмите ↵ Enter.
-
После команды start обязательно поставьте пробел.
-
Введите имя программы так, как оно отображается в папке с программными файлами, а затем нажмите ↵ Enter. Программа будет запущена.
- Если в названии программы есть пробелы, вместо них введите знак подчеркивания «_» (например, system_shock, а не system shock).
Реклама
Советы
- Чтобы открыть любую программу с помощью командной строки, устанавливайте программы в папку «Документы».
Реклама
Предупреждения
- Если у вас нет административного доступа к компьютеру, возможно, у вас не получится открыть окно командной строки или внести изменения в настройки пути.
Реклама
Об этой статье
Эту страницу просматривали 469 306 раз.
Была ли эта статья полезной?
-
Home
-
News
- How to Run Program from CMD (Command Prompt) Windows 10
By Alisa |
Last Updated
You can run a program or an exe file from Command Prompt. Check how to do it in this tutorial. MiniTool software, not only provides many useful computer solutions, but also provides users many useful computer software like data recovery program, disk partition manager, system backup and restore software, video editor, etc.
If you want to run program from CMD (Command Prompt) on Windows 10, you can check the detailed steps below.
How to Run a Program from CMD in Windows 10
You can only run the applications that are installed in Windows-created folders like Explorer in Command Prompt.
Step 1. Open Command Prompt in Windows 10
At first, you should open Command Prompt application on your Windows 10 computer. You can press Windows + R, type cmd, and press Enter to open normal Command Prompt or press Ctrl + Shift + Enter to open elevated Command Prompt on Windows 10.
Step 2. Run Program from CMD on Windows 10
Next you can type start <program name> command in Command Prompt window, and press Enter to open the target application in CMD. Replace the “program name” with the exact file’s system name of the program but not its shortcut name. For instance: start explorer.
The file’s system name of some common programs in Windows are as follows:
- Command Prompt: cmd
- File Explorer: explorer
- Task Manager: taskmgr
- Calculator: calc
- Notepad: notepad
- Paint: mspaint
- Windows Media Player: wmplayer
How to Run EXE in CMD on Windows 10
You can follow the instructions below to run an exe file in Command Prompt.
Step 1. Access Command Prompt window
You can follow the same operation above to open Command Prompt in Windows 10.
Step 2. Navigate to the folder of the target program
Next you can type cd <file path> command in Command Prompt window, and press Enter to navigate to the folder that contains the target exe application. Replace “file path” with the exact file path of the exe file.
You can find the target program folder and click the address bar at the top of File Explorer window to copy the path of the program folder and paste it after cd command. For example, cd C:\Program Files\Windows Media Player.
Step 3. Run exe from CMD
After you are in the target program folder path, then you can type start <filename.exe> after the selected file path in CMD, and press Enter to run the exe file in Command Prompt. Replace “filename.exe” with the target program name, e.g. start wmplayer.exe.
Bottom Line
This post introduces how to run a program or exe file from CMD on Windows 10. Hope it helps.
If you need a free data recovery software to recover deleted/lost files from Windows 10 computer or other storage devices, you can try MiniTool Power Data Recovery.
MiniTool Power Data Recovery is a Windows data recovery program that allows you to recover data from PC, external hard drive HDD or SSD, USB drive, SD card, memory card, and more. It is very simple to use and 100% clean.
About The Author
Position: Columnist
Alisa is a professional English editor with 4-year experience. She loves writing and focuses on sharing detailed solutions and thoughts for computer problems, data recovery & backup, digital gadgets, tech news, etc. Through her articles, users can always easily get related problems solved and find what they want. In spare time, she likes basketball, badminton, tennis, cycling, running, and singing. She is very funny and energetic in life, and always brings friends lots of laughs.
The Windows command line is one of the most powerful utilities on a Windows PC. With it, you can interact with the OS directly and do a lot of things not available in the graphical user interface (GUI).
In this article, I’ll show you 40 commands you can use on the Windows command line that can boost your confidence as a Windows user.
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.
In addition, some of these commands require you to open the command prompt as an admin.
powershell start cmd -v runAs – Run the Command Prompt as an Administrator
Entering this command opens another command prompt window as an administrator:
driverquery – Lists All Installed Drivers
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
systeminfo – Shows Your PC’s Details
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
prompt – Changes the Default Text Shown before Entering Commands
By default, the command prompt shows the C drive path to your user account.
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
For example, dir | clip copies all the content of the present working directory 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
title – Changes the Command Prompt Window Title Using the Format title window-title-name
fc – Compares Two Similar Files
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
On a PC, deleted files remain accessible to you and other users. So, technically, they are not deleted under the hood.
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
ping – Shows a Website IP Address, Lets you Know How Long it Takes to Transmit Data and a Get Response
color – Changes the Text Color of the Command Prompt
Enter color attr to see the colors you can change to:
Entering color 2 changes the color of the terminal to green:
for /f "skip=9 tokens=1,2 delims=:" %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
ipconfig – Shows Information about PC IP Addresses and Connections
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:\Windows\system32\energy-report.html.
dir – Lists Items in a Directory
del – Deletes a File
attrib +h +s +r folder_name – Hides a Folder
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
tree – Shows the Tree of the Current Directory or Specified Drive
ver – Shows the Version of the OS
tasklist – Shows Open Programs
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
time – Shows and Changes the Current Time
vol – Shows the Serial Number and Label Info of the Current Drive
dism – Runs the Deployment Image Service Management Tool
CTRL + C – Stops the Execution of a Command
-help – Provides a Guide to other Commands
For example, powercfg -help shows how to use the powercfg command
echo – Shows Custom Messages or Messages from a Script or File
You can also use the echo command to create a file with this syntax echo file-content > filename.extension.
mkdir – Creates a Folder
rmdir – Deletes a Folder
N.B.: The folder must be empty for this command to work.
more – Shows More Information or the Content of a File
move – Moves a File or Folder to a Specified Folder
ren – Renames a File with the Syntax ren filename.extension new-name.extension
cls – Clears the Command Line
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
shutdown – Shuts down, Restarts, Hibernates, Sleeps the Computer
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.
Conclusion
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.
If you find the commands helpful, share the article with your friends and family.
In case you know another useful command I did not list, tell me about it on Twitter. I will add it and mention you as the source.
Learn to code for free. freeCodeCamp’s open source curriculum has helped more than 40,000 people get jobs as developers. Get started
