How to run a program from the command line

Table of contents:

How to run a program from the command line
How to run a program from the command line
Anonim

This article will show you how to run a program from the command line on a Windows computer. You can run a program that is stored in a folder created by Windows (for example, on the desktop). Also, the program folder can be added to the command line list to run this program from the command line.

Steps

Method 1 of 2: How to start the main program

Run a Program on Command Prompt Step 1
Run a Program on Command Prompt Step 1

Step 1. Open the Start Menu

Windowsstart
Windowsstart

Click on the Windows logo in the lower left corner of the screen. Or press the ⊞ Win key on your keyboard.

In Windows 8, move your mouse to the upper-right corner of the screen, and then click the magnifying glass icon

Run a Program on Command Prompt Step 2
Run a Program on Command Prompt Step 2

Step 2. In the Start menu search bar, enter Command Prompt

The command line icon will be displayed.

Run a Program on Command Prompt Step 3
Run a Program on Command Prompt Step 3

Step 3. Click on the command line icon

Windowscmd1
Windowscmd1

It's at the top of the Start menu. A command prompt window will open.

If you are logged in as a guest, the Command Prompt window will not open

Run a Program on Command Prompt Step 4
Run a Program on Command Prompt Step 4

Step 4. At the command prompt, enter start

Be sure to put a space after the start command.

Run a Program on Command Prompt Step 5
Run a Program on Command Prompt Step 5

Step 5. Enter the name of the program on the command line

This refers to the system name of the program, not the name of its shortcut (for example, the system name of the command line: cmd). The following are the system names of the main programs:

  • Conductor: explorer
  • Notebook: notepad
  • table of symbols: charmap
  • Paint: mspaint
  • Command line (new window): cmd
  • Windows Media Player: wmplayer
  • Task Manager: taskmgr
Run a Program on Command Prompt Step 6
Run a Program on Command Prompt Step 6

Step 6. Press ↵ Enter

The command you entered should look something like start program_name. The specified program will be launched within a few seconds after the execution of the "start" command.

If the selected program does not start, it is most likely not included in the list of command line programs. In this case, skip to the next section

Method 2 of 2: How to start another program

Run a Program on Command Prompt Step 7
Run a Program on Command Prompt Step 7

Step 1. Open the Start Menu

Windowsstart
Windowsstart

Click on the Windows logo in the lower left corner of the screen. Or press the ⊞ Win key on your keyboard.

Run a Program on Command Prompt Step 8
Run a Program on Command Prompt Step 8

Step 2. Open File Explorer

Windowsstartexplorer
Windowsstartexplorer

To do this, click on the folder-shaped icon at the bottom left of the Start window.

Run a Program on Command Prompt Step 9
Run a Program on Command Prompt Step 9

Step 3. Open the folder where the program is located

Navigate to the folder with the files of the program you want to open.

  • When the icon of the program that you want to start using the command line appears in the Explorer window, then you are in the correct folder.
  • If you don't know where the program is, look for it in the Program Files folder on your hard drive or use the search bar (above).
Run a Program on Command Prompt Step 10
Run a Program on Command Prompt Step 10

Step 4. Select the path to the program folder

Click on the right side of the address bar at the top of the Explorer window. The content of the address bar will be highlighted in blue.

Run a Program on Command Prompt Step 11
Run a Program on Command Prompt Step 11

Step 5. Copy the path to the folder

To do this, press Ctrl + C.

Run a Program on Command Prompt Step 12
Run a Program on Command Prompt Step 12

Step 6. Click on This PC

This folder is on the left side of the Explorer window.

Run a Program on Command Prompt Step 13
Run a Program on Command Prompt Step 13

Step 7. Click This PC again

This will deselect any folder within the This PC folder, allowing you to open the properties of the This PC folder.

Run a Program on Command Prompt Step 14
Run a Program on Command Prompt Step 14

Step 8. Click on Computer

It's a tab in the upper-left side of the page. The toolbar will open.

Run a Program on Command Prompt Step 15
Run a Program on Command Prompt Step 15

Step 9. Click Properties

The icon for this button looks like a white square with a red check mark. A pop-up window will open.

Run a Program on Command Prompt Step 16
Run a Program on Command Prompt Step 16

Step 10. Click Advanced System Settings

This link is in the upper-left side of the window. Another pop-up window will open.

Run a Program on Command Prompt Step 17
Run a Program on Command Prompt Step 17

Step 11. Click the Advanced tab

It's at the top of the window.

Run a Program on Command Prompt Step 18
Run a Program on Command Prompt Step 18

Step 12. Click Environment Variables

It's near the bottom of the window. Another window will open.

Run a Program on Command Prompt Step 19
Run a Program on Command Prompt Step 19

Step 13. Click on Path

It's in the System Variables window at the bottom of the page.

Run a Program on Command Prompt Step 20
Run a Program on Command Prompt Step 20

Step 14. Click Change

It's near the bottom of the page.

Run a Program on Command Prompt Step 21
Run a Program on Command Prompt Step 21

Step 15. Click Create

It's in the upper-right side of the Edit page.

Run a Program on Command Prompt Step 22
Run a Program on Command Prompt Step 22

Step 16. In the "Path" window, paste the path to the required program

To do this, press Ctrl + V.

Run a Program on Command Prompt Step 23
Run a Program on Command Prompt Step 23

Step 17. Click OK

The inserted path will be saved.

Run a Program on Command Prompt Step 24
Run a Program on Command Prompt Step 24

Step 18. Open a command prompt window (read the previous section)

Run a Program on Command Prompt Step 25
Run a Program on Command Prompt Step 25

Step 19. Open the path to the program

Type cd at the command line, then put a space, press Ctrl + V to enter the path to the program, and then press ↵ Enter.

Run a Program on Command Prompt Step 26
Run a Program on Command Prompt Step 26

Step 20. At the command line, enter start

Be sure to put a space after the start command.

Run a Program on Command Prompt Step 27
Run a Program on Command Prompt Step 27

Step 21. Enter the name of the program

Enter the program name as it appears in the program files folder, then press ↵ Enter. The program will start.

If there are spaces in the program name, enter the underscore "_" instead (for example, system_shock, not system shock)

Advice

To open any program from the command line, install the programs in the Documents folder

Popular by topic