How to Run a Program from the Command Prompt

Table of contents:

How to Run a Program from the Command Prompt
How to Run a Program from the Command Prompt
Anonim

This article shows how to run a program on a Windows system using the "Command Prompt". Remember that, by default, you can only run programs installed in directories created by the operating system (for example the "desktop" directory); however, by modifying the "Path" system variable (again via the "Command Prompt") you will be able to run any software on your computer.

Steps

Method 1 of 2: Run the Basic Programs

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

Step 1. Access the "Start" menu by clicking the icon

Windowsstart
Windowsstart

It features the classic Windows logo and is located in the lower left corner of the desktop. Alternatively, you can press the "Windows" key on your keyboard.

If you are using a Windows 8 system, you will need to place the mouse cursor in the upper right corner of the desktop and select the "Search" icon with a magnifying glass

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

Step 2. Type the keywords command prompt in the "Start" menu

This will search the entire computer for the "Command Prompt" application.

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

Step 3. Select the "Command Prompt" item indicated by the icon

Windowscmd1
Windowscmd1

It has a small black square and will appear at the top of the search results list. A new window will open for the selected program.

If you are using a computer that has restrictions on what the user can do, you may not be able to start the "Command Prompt"

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

Step 4. Type the command start in the "Command Prompt" window

Make sure you also include the white space after the start keyword.

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

Step 5. Now type the name of the program you want to run

This is the name of the executable file (EXE) related to the program in question and not the name of the shortcut icon (for example in the case of the "Command Prompt" the executable file is called cmd.exe). Here is a short list of file names related to the most used Windows programs:

  • File Explorer - explorer.exe;
  • Block notes - notepad.exe;
  • Character map - charmap.exe;
  • Paint - mspaint.exe;
  • Command Prompt (a new window will open) - cmd.exe;
  • Windows Media Player - wmplayer.exe;
  • Task Manager - taskmgr.exe.
Run a Program on Command Prompt Step 6
Run a Program on Command Prompt Step 6

Step 6. Press the Enter key

The command start [program_name] exploits the potential of the "start" system software to execute the indicated program. A few seconds after pressing the "Enter" key, you should see the desired application window appear on the screen.

If the program in question does not run, it is most likely because it resides in a system folder not included in the "Path" variable of the "Command Prompt", which is therefore unreachable for the latter. If this is your case, consult this article method to find out how to change the system "Path" and fix the problem

Method 2 of 2: Run a Specific Program

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

Step 1. Access the "Start" menu by clicking the icon

Windowsstart
Windowsstart

It features the classic Windows logo and is located in the lower left corner of the desktop. Alternatively, you can press the "Windows" key on your keyboard.

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

Step 2. Select the "File Explorer" application indicated by the icon

Windowsstartexplorer
Windowsstartexplorer

The latter is characterized by a folder and is located in the lower left part of the "Start" menu.

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

Step 3. Go to the directory where the file to be executed is stored

Use the "File Explorer" window to open the folder structure containing the one for the program to run.

  • You will know that you have reached the correct folder when the icon of the desired program appears in the right pane of the "File Explorer" window.
  • If you do not know the exact path of the file to run, consider that in most cases the programs installed on a Windows system are stored in the "Programs" directory of the hard disk. Alternatively, you can perform a search using the appropriate text field located in the upper right part of the "File Explorer" window.
Run a Program on Command Prompt Step 10
Run a Program on Command Prompt Step 10

Step 4. Select the path to the folder where the file to be executed resides

Click an empty spot in the address bar at the top of the "File Explorer" window. This way the current folder path should appear highlighted in blue.

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

Step 5. Copy the selected path

Press the key combination Ctrl + C.

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

Step 6. Now click the This PC icon

It is one of the folders located inside the left pane of the "File Explorer" window.

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

Step 7. Select the This PC item again

In this way any folder present within the directory This PC it will be automatically deselected giving you the possibility to open the "Properties" window of the latter.

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

Step 8. Go to the Computers tab

It is located in the upper left of the "File Explorer" window. A toolbar different from the default one will be displayed.

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

Step 9. Press the Properties button

It has a white icon with a red check mark inside it. The "System" window will appear.

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

Step 10. Select the Advanced System Settings link

It is located in the upper left part of the appeared window. This will bring up the "System Properties" dialog box.

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

Step 11. Go to the Advanced tab

It is located at the top of the "System Properties" window.

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

Step 12. Press the Environment Variables… button

It is located at the bottom right of the "Advanced" tab. You will have access to the dialog box from which you can change the value of the Windows environment variables.

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

Step 13. Select the Path variable

It is displayed in the "System Variables" box at the bottom of the window.

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

Step 14. Press the Edit… button

It is located in the lower right of the "System Variables" pane.

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

Step 15. Press the New button

It is located in the upper right corner of the "Edit Environment Variable" window that appears.

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

Step 16. Now paste the path of the file you want to run

Simply press the key combination Ctrl + V.

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

Step 17. Press the OK button

The new path will be stored in the "Path" environment variable.

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

Step 18. Open the "Command Prompt"

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

Step 19. Navigate to the path where the file to be executed resides

Type the command cd inside the "Command Prompt" window, followed by a blank space, then paste the file path by pressing the key combination Ctrl + V and press Enter.

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

Step 20. Type the command start in the "Command Prompt" window

Make sure you also include the white space after the start keyword.

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

Step 21. Enter the name of the executable file for the program in question

Make sure you type exactly the name that appears inside the folder it's stored in, then hit the Enter key. The indicated program should start without any problems.

Recommended: