Windows run command from cmd

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

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

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

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

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

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

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.

Windows-Command-Prompt-Tutorial

Complete Windows Command Prompt Tutorial

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 (например, на рабочем столе). Также папку с программой можно добавить в список командной строки, чтобы запустить эту программу из командной строки.

  1. Step 1 Откройте меню «Пуск» icon.

    Щелкните по логотипу Windows в нижнем левом углу экрана. Или нажмите клавишу Win на клавиатуре.

    • В Windows 8 передвиньте указатель мыши в верхний правый угол экрана, а затем щелкните по значку в виде лупы.
  2. Step 2 В строке поиска меню «Пуск» введите командная строка.

    Отобразится значок командной строки.

  3. Step 3 Щелкните по значку командной строки icon.

    Он находится в верхней части меню «Пуск». Откроется окно командной строки.

    • Если вы вошли в систему в качестве гостя, окно командной строки не откроется.
  4. Step 4 В командной строке введите start .

    После команды start обязательно поставьте пробел.

  5. Step 5 Введите имя программы в командной строке.

    Имеется в виду системное имя программы, а не имя ее ярлыка (например, системное имя командной строки: cmd). Ниже приведены системные имена основных программ:

    • Проводник: explorer
    • Блокнот: notepad
    • Таблица символов: charmap
    • Paint: mspaint
    • Командная строка (новое окно): cmd
    • Windows Media Player: wmplayer
    • Диспетчер задач: taskmgr
  6. Step 6 Нажмите ↵ Enter.

    Введенная команда должна выглядеть примерно так: start имя_программы. Указанная программа будет запущена в течение нескольких секунд после исполнения команды «start».

    • Если выбранная программа не запустилась, скорее всего, она не включена в список программ командной строки. В этом случае перейдите к следующему разделу.

    Реклама

  1. Step 1 Откройте меню «Пуск» icon.

    Щелкните по логотипу Windows в нижнем левом углу экрана. Или нажмите клавишу Win на клавиатуре.

  2. Step 2 Откройте Проводник icon.

    Для этого щелкните по значку в виде папки в нижней левой части окна «Пуск».

  3. Step 3 Откройте папку, в которой находится программа.

    Перейдите в папку с файлами программы, которую нужно открыть.

    • Когда значок программы, которую необходимо запустить с помощью командной строки, отобразится в окне Проводника, значит, вы — в нужной папке.
    • Если вы не знаете, где находится программа, поищите ее в папке «Program Files» на жестком диске или воспользуйтесь строкой поиска (сверху).
  4. Step 4 Выделите путь к папке с программой.

    Щелкните по правой стороне адресной строки, которая находится в верхней части окна Проводника. Содержимое адресной строки будет выделено синим маркером.

  5. Step 5 Скопируйте путь к папке.

    Для этого нажмите Ctrl+C.

  6. Step 6 Щелкните по Этот ПК.

    Эта папка находится в левой части окна Проводника.

  7. Step 7 Еще раз нажмите Этот ПК.

    Так будет отменено выделение любой папки внутри папки «Этот ПК», что позволит открыть свойства папки «Этот ПК».

  8. Step 8 Щелкните по Компьютер.

    Это вкладка находится в верхней левой части страницы. Откроется панель инструментов.

  9. Step 9 Нажмите Свойства.

    Значок этой кнопки имеет вид белого квадрата с красной галочкой. Откроется всплывающее окно.

  10. Step 10 Нажмите Дополнительные параметры системы.

    Эта ссылка находится в верхней левой части окна. Откроется другое всплывающее окно.

  11. Step 11 Щелкните по вкладке Дополнительно.

    Она находится в верхней части окна.

  12. Step 12 Нажмите Переменные среды.

    Эта опция находится в нижней части окна. Откроется другое окно.

  13. Step 13 Щелкните по Path (Путь).

    Эта опция находится в окне «Системные переменные» в нижней части страницы.

  14. Step 14 Нажмите Изменить.

    Эта опция находится в нижней части страницы.

  15. Step 15 Нажмите Создать.

    Эта опция находится в верхней правой части страницы «Изменить».

  16. Step 16 В окне «Путь» вставьте путь к нужной программе.

    Для этого нажмите Ctrl+V.

  17. Step 17 Щелкните по OK.

    Вставленный путь будет сохранен.

  18. Step 18 Откройте окно командной строки (читайте предыдущий раздел).

  19. Step 19 Откройте путь к программе.

    Введите cd в командной строке, затем поставьте пробел, нажмите Ctrl+V, чтобы ввести путь к программе, а потом нажмите Enter.

  20. Step 20 В командной строке введите start .

    После команды start обязательно поставьте пробел.

  21. Step 21 Введите имя программы.

    Введите имя программы так, как оно отображается в папке с программными файлами, а затем нажмите 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.

how to run a program in Command Prompt

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.

how to run exe file in Command Prompt

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.

Command Line Commands – CLI Tutorial

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.

ss5-1

powershell start cmd -v runAs – Run the Command Prompt as an Administrator

Entering this command opens another command prompt window as an administrator:

ss1-1

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.

ss2-1

chdir or cd – Changes the Current Working Directory to the Specified Directory

ss3-1

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.

ss4-1

set – Shows your PC’s Environment Variables

ss5-2

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:

ss6-1

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.

ss7

You can type clip /? and hit ENTER to see how to use it.

assoc – Lists Programs and the Extensions They are Associated With

ss8

title – Changes the Command Prompt Window Title Using the Format title window-title-name

ss9

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”.

ss10

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.

ss11

netstat -an – Shows Open Ports, their IP Addresses and States

ss12

ping – Shows a Website IP Address, Lets you Know How Long it Takes to Transmit Data and a Get Response

ss13

color – Changes the Text Color of the Command Prompt

Enter color attr to see the colors you can change to:

ss14

Entering color 2 changes the color of the terminal to green:

ss15

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

ss16

ipconfig – Shows Information about PC IP Addresses and Connections

ss17

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.

ss18

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.

ss19

For example, you can use powercfg /energy to generate a battery health report.

ss20

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

ss21

del – Deletes a File

ss22

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.

ss23

start website-address – Logs on to a Website from the Command Line

ss24

ss25

tree – Shows the Tree of the Current Directory or Specified Drive

ss26

ver – Shows the Version of the OS

ss27

tasklist – Shows Open Programs

You can do the same thing you do with the task manager with this command:

ss28

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:

ss29

date – Shows and Changes the Current Date

ss30

time – Shows and Changes the Current Time

ss31

vol – Shows the Serial Number and Label Info of the Current Drive

ss32

dism – Runs the Deployment Image Service Management Tool

ss33

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

ss34

echo – Shows Custom Messages or Messages from a Script or File

ss35

You can also use the echo command to create a file with this syntax echo file-content > filename.extension.

ss36

mkdir – Creates a Folder

ss37

rmdir – Deletes a Folder

ss38

N.B.: The folder must be empty for this command to work.

more – Shows More Information or the Content of a File

ss39

move – Moves a File or Folder to a Specified Folder

ss40

ren – Renames a File with the Syntax ren filename.extension new-name.extension

ss41-1

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.

cls

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.

ss42

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

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

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Перенос данных между учетными записями windows 10
  • Windows 95 setup sound
  • Windows список зарегистрированных библиотек
  • Перезапустить службу windows из командной строки
  • C windows system32 msxml6 dll