How to run a program from the command line: three easy ways

Users of the Windows operating system are used to running all programs by double-clicking their icons with the left mouse button. However, few people know that the same action can be performed in the system console. This article will talk about how to run program c through the command line. In total, we consider three methods. In the end, we will provide a method that allows you to run the program through a shortcut, but with console parameters.

How to run the program from the command line?

Immediately it is worth saying that all of the methods described below are mostly similar. However, the command line is a specific tool, and depending on what attributes you use to open the application, the properties of the latter will change.

Method 1: launch the system application

First of all, we will tell you how to run a program from the command line, if it is a system one. Perhaps this is the easiest method, because to execute it you need to know only one command - start. And, of course, the name of the application itself. The most popular system programs will be listed below:

Team

Program
taskmgrTask Manager
controlControl Panel
msconfigWindows configuration
explorerFile Manager "Explorer"
notepadNotebook
wmplayerWindows Media Player
mspaintPaint Editor
charmapsymbol table
cmd

Command line (a second window will open at startup)

As a result, to start a specific program you need to write the word start and enter its name separated by a space. In practice, it looks like this:

start control
      
      



Method 2: specify the full path to the file

Unfortunately, starting the program from a third-party developer in the previous way will not work, but there is another method. It consists in entering the full path to the executable file. For example, you have on the C system drive the installer of some program called install.exe. To start it, you will need to enter the following command:





 C:\install.exe
      
      



how to run a program from the command line




Accordingly, if the file will be located in another folder, then in the line you need to enter all the directories that follow before the file. By the way, it is very important that there are no spaces in the folder name. Otherwise, an error will appear. Eliminating it is quite simple - you need to quote all the way. For instance:

 "C:\    \ .exe"
      
      



Method 3: using path

The third way to start the program from the command line is to use the patch command. Its essence is to remember the specified directory. That is, you need to enter the address not to the file itself, but to the folder where it is located. For example, you need to open Total Commander, which is located at the following address:

 c:\program files\total commander
      
      



Then in the console, enter the following command:

 patch "c:\program files\total commander"
      
      



The command line will remember the directory you specified and will run all the files from it if you enter their name. Thus, to launch Total Commander it remains only to write its name:

 totalcmd
      
      



how to run program c through the command line




How to run a program with command line options?

Now we will pass directly to how to start the application with console parameters. By the way, this is done quite simply, you don’t even have to open the command line - everything is done in the properties of the shortcut.

  1. Right click on the program shortcut.
  2. Select "Properties."
  3. Click the Shortcut tab.
  4. In the "Object" field, add the desired parameter after the quotation marks.
  5. Click apply and close the window.
how to run a program with command line options




Now the program will start with the specified parameter, you just need to double-click on its shortcut. So we examined all the ways how to run the program from the command line. Well, which one to use is up to you.




All Articles