How to Run Program from CMD (Command Prompt) Windows 10
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 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
Use ipconfig Commands to Get/Renew IP Address & Flush DNS
Check how to use ipconfig commands in Command Prompt to get IP address, release and renew IP address, display/reset/flush DNS, etc. on a Windows 10/11 computer.
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 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 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.
8 Best Free Word Processors for Windows 10/11 to Edit Docs
This post introduces the 8 best free word processors for Windows 10/11 that let you easily create, edit, save, and print documents on your PC.
start
Starts a separate Command Prompt window to run a specified program or command.
Syntax
start ["title"] [/d ] [/i] [] [] [] [/node ] [/affinity ] [/wait] [/b] [/machine ] [ [. ] | [. ]]
The machine parameter is currently in PREVIEW for Windows 11 only. The parameter is available beginning with the Windows 11 Insider Preview Build 22557. This information relates to a prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, expressed or implied, with respect to the information provided here.
Parameters
Parameter | Description |
---|---|
Specifies the title to display in the Command Prompt window title bar. | |
/d | Specifies the startup directory. |
/i | Passes the Cmd.exe startup environment to the new Command Prompt window. If /i isn’t specified, the current environment is used. |
Specifies to minimize ( /min ) or maximize ( /max ) the new Command Prompt window. | |
Starts 16-bit programs in a separate memory space ( /separate ) or shared memory space (/shared). These options aren’t supported on 64-bit platforms. | |
Starts an application in the specified priority class. | |
/node | Specifies the preferred Non-Uniform Memory Architecture (NUMA) node as a decimal integer. |
/affinity | Applies the specified processor affinity mask (expressed as a hexadecimal number) to the new application. |
/wait | Starts an application and waits for it to end. |
/b | Starts an application without opening a new Command Prompt window. CTRL+C handling is ignored unless the application enables CTRL+C processing. Use CTRL+BREAK to interrupt the application. |
/machine | Specifies the machine architecture of the application process. |
[ [. ] \| [. ]] | Specifies the command or program to start. |
Specifies parameters to pass to either the command or the program. | |
/? | Displays help at the command prompt. |
Remarks
- You can run non-executable files through their file association by typing the name of the file as a command.
- If you run a command that contains the string CMD as the first token without an extension or path qualifier, CMD is replaced with the value of the COMSPEC variable. This prevents users from picking up cmd from the current directory.
- If you run a 32-bit graphical user interface (GUI) application, cmd doesn’t wait for the application to quit before returning to the command prompt. This behavior doesn’t occur if you run the application from a command script.
- If you run a command that uses a first token that isn’t a command or the file path to an existing file with an extension, Cmd.exe uses the value of the PATHEXT environment variable to determine which extensions to look for and in what order. The default value for the PATHEXT variable is .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC Note the syntax is the same as the PATH variable, with semicolons (;) separating each extension.
- start searches for a specified executable file, and if found the executable will launch regardless of the current working directory. When searching for an executable file, if there’s no match on any extension, start checks to see if the name matches a directory name. If it does, start opens Explorer.exe on that path.
Examples
To start the Myapp program at the command prompt and retain use of the current Command Prompt window, type:
start Myapp
To view the start command-line help topic in a separate maximized Command Prompt window, type:
start /max start /?
Related links
Как запустить программу через командную строку в Windows 10, 7
При работе с командной строкой и написании командных файлов часто возникает необходимость в запуске других программ. В данной статье мы рассмотрим несколько способов, как можно запускать программы через командную строку в операционных системах Windows 10 и Windows 7.
Запуск по названию исполняемого файла
Многие программы в командной строке можно запускать просто указав название их исполняемого файла. Например, вы можете ввести в командную строку « notepad » и запустить программу « Блокнот » или ввести « mspaint » и запустить « Paint ».
Это работает благодаря переменной окружения « PATH » в которой записан список папок, где Windows должна искать исполняемые файлы для программ. Список этих папок можно просмотреть, если ввести в командную строку команду « path ».
Если вы хотите запустить программу из другой папки, которая не указана в переменной « PATH », то вы можете временно изменить папку для поиска исполняемых файлов. Для этого нужно ввести команду « path » и через пробел указать путь к нужной папке. Например, мы можем указать путь к папке с программой AkelPad:
path "C:\Program Files (x86)\AkelPad"
И потом запустить эту программу выполнив команду «akelpad»:
akelpad
Нужно отметить, что команда «path» влияет только на текущий сеанс командной строки, при этом значение переменной « PATH » не меняется.
Запуск с указанием полного пути
Еще один способ запуска программ – это указание полного пути к исполняемому exe-файлу. Для этого достаточно вставить в командную строку полный путь и указанная программа будет запущена.
Например, для запуска программы AkelPad в командную строку нужно вставить следующее:
"C:\Program Files (x86)\AkelPad\AkelPad.exe"
Обратите внимание, если путь содержит пробелы, то его нужно взять в кавычки, в других случаях кавычки не обязательны.
Запуск с помощью команды «start»
Также для запуска других программ можно использовать команду «s tart ». С ее помощью можно запускать как программы для командной строки, так и приложения с графическим интерфейсом.
Для запуска программ данным способом нужно ввести команду « start » и через пробел указать название программы. Например, для того чтобы запустить текстовый редактор «Блокнот» нужно выполнить следующее:
start notepad
Как и в предыдущем случае, Windows будет искать исполняемый файл в папках, которые указаны в переменной окружения « PATH ».
Но, команда « start » позволяет и вручную указать путь к папке с программой. Для этого нужно использовать параметр « /D ».
Например, для того чтобы запустить программу « akelpad » из папки « C:\Program Files (x86)\AkelPad » нужно выполнить следующее:
start /D "C:\Program Files (x86)\AkelPad" akelpad
Одной из особенностей команды « start » является то, что она позволяет запускать программы с высоким приоритетом.
Как перезапустить программу через командную строку
В некоторых случаях возникает необходимость перезапустить программу через командную строку. Это может потребоваться если программа зависла, работает неправильно или требует регулярного перезапуска. Для этого нужно сначала остановить работающую программу, а потом запустить ее заново.
Для остановки запущенной программы можно использовать команду taskkill. Например, чтобы принудительно (параметр /F ) останавить работу процесса « Viber.exe » нужно выполнить:
taskkill /F /IM Viber.exe
После остановки программы ее можно повторно запустить с помощью команды « start ». Например, чтобы перезапустить Viber через командную строку нужно выполнить:
start /D "%LocalAppData%\Viber" Viber
Здесь « %LocalAppData%\Viber » — это путь к папке с программой, а « Viber » — название исполняемого exe-файла в этой папке.
Эти две команды можно объединить в одну с помощью оператора « && ». В этом случае команда для перезапуска Viber будет выглядеть так:
taskkill /F /IM Viber.exe && start /D "%LocalAppData%\Viber" Viber
Обратите внимание, завершая программы с помощью « taskkill /F » вы можете потерять несохраненные данные.
- Выключение компьютера через командную строку
- Как перезагрузить компьютер через командную строку
- Как вызвать командную строку в Windows 7
- Как поменять дату в Windows 7
- Как выключить компьютер через определенное время
Создатель сайта comp-security.net, автор более 2000 статей о ремонте компьютеров, работе с программами, настройке операционных систем.
Остались вопросы?
Задайте вопрос в комментариях под статьей или на странице «Задать вопрос» и вы обязательно получите ответ.
При подготовке материала использовались источники:
https://www.minitool.com/news/run-program-from-cmd.html
https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/start
https://comp-security.net/%D0%BA%D0%B0%D0%BA-%D0%B7%D0%B0%D0%BF%D1%83%D1%81%D1%82%D0%B8%D1%82%D1%8C-%D0%BF%D1%80%D0%BE%D0%B3%D1%80%D0%B0%D0%BC%D0%BC%D1%83-%D1%87%D0%B5%D1%80%D0%B5%D0%B7-cmd/