Work with programs via the command line

Dear friends, it’s no secret that Linux-based users always keep their nose on those who work on Windows. They say that for Windows you need to install the application for at least 10 minutes, pressing a large number of buttons, poking around with checkmarks. And before, in fact, install the application, you need to find the official website of the program, while not getting lost on the Internet. Linux users are proud that they can install any utility from the terminal by executing a certain command.

On Windows, as in Linux, there is the ability to install, remove, or edit programs using commands.

The developers claim that in Windows 10 it will also be possible to quickly install, update and remove various software from the system terminal. It remains to wait for the official release. But you can not wait for the release, but right now take advantage of an amazing feature that will allow the user to install the program from the command line. However, this is not all surprises: the utility will also allow you to delete, update, open and close the program. Interesting? Let's take a closer look at Chocolatey.

Installing the program via the command line

Now we will try to manage programs in a more convenient and very similar way to how this is done in the Linux environment. And this will help us a special service Chocolatey, a package manager for Windows. The Chocolatey client is a console utility. Let's immediately try to install it. To install, open the terminal with administrator rights. Right-click on the Start menu and click "Command Prompt" (with administrator rights). Now copy the following code:

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient) .DownloadString ('// chocolatey.org/install.ps1'))" && SET PATH =% PATH;% ALLUSERSPROFILE% \ chocolatey \ bin

Paste and press Enter. Now you need to close the console so that the data on the variables are refreshed.

A large catalog of utilities and applications has been assembled on the Chocolatey service: there are currently more than 2000 utilities. You can see them on the official website //chocolatey.org/packages. So, it's time to learn how to install any program via the command line:

Again, open the terminal on behalf of the administrator. Copy the text presented to the right of the program on the site //chocolatey.org/packages. For example, to install the Google Chrome browser, the following code is presented:

choco install googlechrome -y

Copy it and paste it into the terminal. Do not forget after the code from the site to write a combination of -y. Hit Enter. It now remains to wait for the browser installation to complete. Then you can close the terminal window.

As you can see, the Google Chrome browser is very quickly installed. We didn’t have to click any buttons, choose where to save the files (the default is drive C). By the way, novice users can make a set of their favorite applications in a notebook, so that each time they do not go to the Chocolatey service. To uninstall the program via the command line, enter the uninstall code, then the program name. For example, choco unistall ccleaner.

ATTENTION. The service works only with those packages that are installed through it. That is, if any software is not available for installation through Chocolatey, then you cannot remove it in this way.

How to start or remove a program via the command line

Now consider the way to open the program via the command line. This can be done in three very simple steps. Let's start:

  1. Open the terminal operating system Windows.
  2. In the window that appears, we write the full path to the location of the application launch file. For example, D: /Files/chrome.exe
  3. We press Enter and wait until the system opens what we need.

It's time to learn how to close the program via the command line. For this we need additional taskkill support. Let's start:

  1. Run the terminal you already know.
  2. Write a tasklist and click on the Enter key.

  3. In the list that appears, look at the number of the utility that you want to close. For example, Chrome browser with PID number
  4. Write the code: taskkill / pid 24292 / f - and press the Enter key. Done!

Let's sum up

Dear readers, today we have considered a seemingly difficult topic. But now you know that it is very easy to install or remove some programs from the command line using the Chocolatey service. And also you know how to open or close an application through the same terminal. We hope that you managed to do everything correctly and there were no questions left on the topic. Tell us your opinion and impression in the comments!