How to uninstall a program using the command line. Remove a folder or program from the command line

This lesson will show how to delete a file via command line in windows(7, 8, XP, Vista). The DEL or ERASE commands will help with this, which are used when you cannot delete the file in the usual way. For, DEL and ERASE will not work.

Naturally, for a start. You will get the best results with this action.

If you use this lesson, then the file will be deleted immediately without sending it to the trash.

In cmd enter DEL /? and press Enter to preview the command parameters. If done correctly, you will see an explanation (screenshot below).

Using cmd when booting Windows

Sometimes it becomes necessary to go to cmd before starting the system. Due to the fact that a malicious program is blocking a successful entry or the boot sector of the system is damaged, then the following steps will help you:

  1. Open Command Prompt when Windows boots
  2. In cmd enter DiskPart and hit enter
  3. Next, you need to write list volume and press enter again (see the screenshot below). This will allow you to see the letter of the drive where you want to delete the file.
  4. When prompted, type exit and hit Enter.

Now feel free to enter the options for the delete commands, which are described below.

By doing this, you will delete any file on your computer using the command line.

Deleting a specific file

To delete a specific element, you need to know its name and extension. Otherwise, the likelihood of deleting the wrong thing increases!

In cmd enter the following command and hit enter:

DEL / F / S / Q / A "Full path element with extension"

For example, if I want to delete with the name "delete" and with the extension (.bat) located on the C drive in the "trash" folder, I need to enter the command:

DEL / F / S / Q / A "C: \ garbage \ delete.bat"

Delete all files with or without confirmation from the command line

In this case, you must confirm or deny the actions with letters (Y - yes / N - no) to delete all files in the main directory and subfolders.

To confirm, use the following syntax:

DEL / F / S / Q / A "Full path to folder \ *"

If I need to delete all the files on the D drive from the folder "in the trash", which contains many other directories and files, I use the command:

DEL / F / S / Q / A "D: \ add to cart \ *"

To delete file from command line with confirmation, / P is added to the parameters and looks like this:

DEL / P / F / S / A "D: \ experiment \ *"

It is possible to delete all files with a given extension, then the command will take the form:

DEL / F / S / Q / A "Full path to folder \ *. Extension"

It is especially useful when there are a lot of unnecessary elements of the same type, which are not an option to iterate over manually, but can simply be removed in a batch from cmd.

With the right approach, you can delete file via command line, in a few seconds. Hope the recommendations were helpful. If you are interested in cmd, I advise you to familiarize yourself with the material, which will be no less interesting.

Many users are faced with a situation when, when starting the computer, a command prompt window appears and disappears, indicating the source - C: \ Windows \ System32 \ cmd.exe. In especially severe cases, such a window can pop up constantly, which is quite annoying. Most often, a window appears in Windows 10, less often in versions 7, 8. In this article, we will explain in detail the reasons for this phenomenon and show how to remove this window.

What is causing the cmd.exe line to appear?

The specific source of the command line “C: \ Windows \ System32 \ cmd.exe” is an auto-start process, and it can be either a system service or a third-party application, or a virus activity. It is necessary to distinguish between two situations in which such a window pops up:

  1. At the time of Windows startup. The Desktop is loaded, and then the row window appears. Most often this is due to the background startup of some kind of OS service. The more powerful your hardware, the faster cmd will load and disappear.
  2. The window appears constantly (periodies) during operation. In this case, we must say that the background process constantly freezes, cannot load, or is blocked by the system.

I ran into exactly the first situation, my line appears for just a few seconds and closes. It does not cause any discomfort.

Is this autorun dangerous?

In most cases, the source is a system process and is absolutely not dangerous. The operating system, in the process of loading and working, constantly activates thousands of background processes and hundreds of services. Imagine that the execution of one "heavy" service slows down, and if your CPU is weak, then the hang time only increases. This is especially often observed on dozens, which are more demanding on the iron.

It's another matter when third-party software tries to execute its commands. And even worse, when a virus activity in the background loads the computer.

How do I remove the cmd.exe command line from opening?

In any case, in order to identify the source of the pop-up line, it is necessary to carry out a comprehensive cleaning and verification of Windows 7/8/10 settings. Here's what to do first:


These are all general advice - half-measures, so to speak, that will help with light failures and knocked down parameters. Otherwise, you will have to manually check everything.

Remove the pop-up cmd.exe using the Scheduler

To start, type “Task Scheduler” into the search menu or write in Perform an operation - taskschd.msc. After that, the PZ menu will open, and we do the following:


After you remove / disable all unnecessary, the command line should be gone. A similar procedure can be carried out through erasing run files in the registry - here is a visual video.

Hello everyone. Let's talk today about how to delete folders. But not in the way everyone does it, but in a special way - using the command line ... So look, you have a small opportunity to become a little cooler in terms of computer knowledge ...

Let's first go back a little and find out what this command line is all about and why there are many commands in it. So the command line is, as it were, an echo of those times when there was DOS. This is such a system, well, like Windows in its infancy, there were no windows, there was generally darkness in the literal sense. And so they used it, entered commands and did something there. Well, how would it all have survived to this day, although few people use it.

We will also look at other questions about the command line, I hope that you will be interested in all this!

Well, I wrote it because I know myself why I need to load you with some specific terms ... This command line can work without Windows at all, that's why it is available when restoring Windows ..

The command line itself is little used now, but basically administrators and all sorts of advanced users know how to use it

An important point I have to make to you. This is a piece of advice to tell you. On the command line, you can enter all sorts of commands there, and so on. The main thing here is to pay attention to the path. Just the way. Well, here's the path, that is, for example, there is a folder somewhere, and you enter the path to it, well, to delete it. So, attention, if the path is very long or there are gaps in it, then so that there are no jambs, enclose it in quotes. If the path is short, for example:

C: \ papka1 \ papka2 \ file.txt

Then it does not need to be enclosed in quotes, and if the path is long, there are spaces in it, then it is necessary, well, for example:

"C: \ Program Files (x86) \ Papka papki \ fale papki.txt"

And like this, write it on the command line, in quotes, then there will be no jambs. Well, I hope you understand

How can I delete a folder via the command line?

Deleting a folder on the command line is not at all difficult, I'll show you even more, in the end I hope that the command line will become more clear to you. It has everything you need to learn about all the teams on your own!

Although to be honest, deleting a folder via the command line is not very convenient, but I agree that there are situations when it is simply necessary.

I'll show you using Windows 7 as an example, but in other Windows everything is almost the same, nothing seems to have changed. Look, hold down the Win + R buttons and write there a command such as:

And click OK:


The command line will open, this is a black window:


Here it is, the command line! Now look, here you need to enter a command into this window, then press enter and then the result will be shown. But what command do you need to enter to delete a folder? But which one:

It sort of stands for remove directory, that is, delete a directory (folder).

This command and the path to the folder must be entered into this command line. I specially created a test folder on the C drive and named it Test. And now, to remove it via the command line, I just need to enter the following command:

This is what it looks like on the command line itself:


I press enter and here is the result:


If it seems to you that nothing happened, then you are mistaken! Look, there is no error in the end, which means that everything went fine and the folder was deleted! Then I checked it on the disk and yes, the folder was gone

So, but there is something else interesting. In general, look, there is also such a thing as command keys. Keys are such additional capabilities of the team. Well, the rmdir command has keys that allow you to delete a folder with all its subfolders and files without prompting. As for the requests, I mean that there will be no message saying that you are sure that you want to delete, well, I think you understand. This is what the command looks like to delete a folder with all subfolders and files inside:

rmdir / S / Q C: \ Test

Well, only here, instead of C: \ Test, you specify your folder that you want to delete. Do you know what? Can I type rmdir / at the command line? and an instruction for additional keys will be shown:


But I really admit that these instructions are not always clear to me ...

How can I delete a file via the command line?

The file can also be deleted seamlessly from the command line and it's not difficult either, so don't worry

Look, run the command line again, well, as I showed above. That is, Win + R and write cmd there and click OK and that's it, it appears. To delete a file, you need to use a command such as:

I just thought, well, del means delete. But no! There is no command like delete, so just enter del!

So, look, I have a created test file Test.txt on the C: \ drive, let's try to delete it using the del command, for this we write something like this on the command line:

This is what it looks like on the command line:


And here's the result:


Well, you here again may think, what a business, nothing in the answer is dumb! But no guys, there is no answer from the team, because there are no errors!

I then checked, yes, the Test.txt file was no longer on the system disk, so everything went fine!

But again, I want to tell you more about additional keys, the del command also has them, look, to delete without any queries, you need to add the / Q key:

del / Q C: \ Test.txt

You can see the help for this command, if you enter something like del /?, In the end, this is what you get displayed:


That's it, I think now you know how to delete files using the command line!

I wrote everything, but I forgot to write something interesting! In short, guys, look, for example, you have a C: \ Test folder, and there are a bunch of files in it. Here's how to delete all files in the Test folder, but just text files? To delete all text files, you need to indicate that the name of the files to be deleted does not matter to you, the main thing is that they are text files! Write like this:

del C: \ Test \ *. txt

This asterisk means that all the same damn names, any names will do, the main thing is the file extension, so that everyone who has .txt is removed. Well, I hope it's more or less clear

How to uninstall a program via command line in Windows 7?

But this is already a little interesting thing. I'll show you how to uninstall programs from the command line, but I'll tell you right away, I've never uninstalled like that. Well, somehow it didn’t come to that, there weren’t such terrible problems with the computer that it was necessary to delete it only using the command line ...

But all kinds of things happen in life ...

So let's try. To avoid problems when removing programs from the command line, it is better to run it as an administrator. Here's how to do it easily in Windows 7:


That is, it is clear yes, write the word command in the line there in Start, then it appears in the results and there you already right-click on it and select Run as administrator! Well, in short, it's not difficult

By the way, to start in Windows 10 as administrator, you need to right-click on the Start icon and select Command Prompt from administrator there. Well, or hold down Win + X and there will also be this item in the menu.

Launched the command line from the administrator, great, now we do this. To enter the otherworldly world, where you can delete programs directly from the command line, we write the following command:

We press enter and this world has already opened:


If you see that you also have something like this:

It means that everything worked out for you, you are almost a super-mega-user

Now, to see all installed programs, you need to enter the following command:

product get name

So I entered it and this is what happened:


Guys, I’ll say right away that I entered the command and I think what kind of business, what a jamb, I was already beginning to get upset - after all, there was nothing in response. But judging by the fact that the hard drive was puffing, I waited and waited. The conclusion is that you need to wait a bit for the entire list of programs to be displayed. I have it big, maybe that's why it takes a long time!

Now look, in order to delete some kind of program and at the same time there was no request for confirmation, then you need to enter the following command:

product where name = "HERE_PROGY_NAME" call uninstall / nointeractive

In general, as you can see here the cant is so cant - you need to manually write the program, because you cannot copy it from the command line! And the name of the program must be taken from there! Maybe you can copy it somehow, but I don't know how. Never deleted programs like that

In general, I will now try to delete it this way ... Let's take it as an example, because its name is short in comparison with the other and it was easy to enter, as in Russian. In general, I enter this command:

product where name = "Browser Manager" call uninstall / nointeractive

In short, I entered it:


And here's the result:


You see there is something like this:

Method execution successfull

This means that everything went well! Guys, I don't know what to tell you, but I managed to uninstall this Browser Manager, but still it seems to me that this is some kind of unclear way .. Well damn, how can I delete this via the command line? Well, it happens that when deleting there are still such options, they say, delete and settings, and so on, these options, it is not known, are they disabled or enabled with such a removal? I personally don't know. In short, the thing is, I wrote you how to do it, it works, I checked it myself, but it's better to use the usual uninstallation of programs through the Programs and Features window (Start menu> Control Panel> Programs and Features).

How do I run Command Prompt as Administrator in Windows 7?

I have already shown above how to run the command line as administrator, but now I will show a more universal way. Well, or more correct. In general, I like this method more, so I recommend it.

In general, look, first start the task manager, right-click on the taskbar and select the following item there:


Then in the manager you click the File menu and select New task there:


And then already there you specify the cmd command and click OK:


Well, this is how you can definitely run the command line as administrator.

How to switch to another folder in the command line?

So the command line, how much it can do and how little we know about it ..

Well it is, thinking out loud. For example, if you work in the command line, how can you go to another folder in it? Very simple. If you need, for example, to get into the Java folder, which is located in Program Files (x86), then you need to enter the following command:

cd "C: \ Program Files (x86) \ Java"

Here I pasted this command into the command line:


I pressed enter and here's the result:


That is, you see - everything is simple, hurray, everything will work out for you!

How do I navigate to a different drive in the command line?

For example, you need to switch to another drive on the command line. How to do it right? Actually, I thought that in order to switch to another disk, the cd command would be enough - but it turned out that no, this is not quite what you need. It turns out everything is much simpler, well, I run the command line, this is how it looks:


Well, that is, as usual, the system drive C: \, everything is as usual. But now, to go to disk D, you just need to write a disk and two dots, well, that is, like this:


Then I pressed enter and this is what came out as a result:


Well, that is, as you can see, it all worked, that is, here you just need to write a drive letter and two dots, and that's it!

Well guys, that's all, I honestly hope that everything here was clear to you, that this info helped you answer some question. Good luck and good mood!

12.08.2016

The command line (abbreviated CMD) is a special program that allows you to perform complex operations in Windows. Ordinary users do not use it, since the need for most of the functions is implemented through the familiar window interface. But when bigger problems arise, the command line capabilities can come in handy. This program is suitable for forced deletion of folders, files and work with directories and local drives.

The essence of the work is simple - you enter a command or a series of sequential commands (algorithm), and Windows executes them. Moreover, many processes go through CMD much faster than in the familiar graphical interface. Removing a folder or program on the command line generally takes a couple of clicks.

In this tutorial, we will often use CMD, so first we will consider the issue of launching it. To open the program, use one of the methods below.

Method 1

In the search for "Start" enter "command line" or "cmd" (without quotes). The system will find the utility, you just have to open it.

If you want to know in more detail, and also consider 5 proven methods, you can read an article about this on our portal.

Method 2


Note! CMD can only be run by a computer administrator. Since the command line is capable of making serious changes to the operation of the system, Windows OS does not trust its launch to other users (with the categories of rights "Guest" and "Normal").

How to delete a folder via the command line

Step 1. Launch CMD.

Step 2. To delete, use the "rmdir" (rd) command - you can delete the directory of the Windows file system only with its help. So, we enter the text "RD /?". The utility will familiarize you with the functions for working with folders.

Step 3. We have created a folder with unnecessary files to demonstrate how the utility works. The folder is located on the desktop. When you delete a folder, you must enter the following command: "RD / s", then put a space and enter the path to the folder itself (its address on the computer).

How to find the path to a folder

How do I find out the path to the folder? It takes too long to do this manually, especially if you want to delete multiple directories. Consider our desktop. It is located in the "Users" folder on the drive where you have Windows installed.

  1. In our case, the system is on the local drive C. We go into it.

  2. Then to the users directory.

  3. And then we select a specific user.

  4. There we see the "Desktop" - open it.

  5. At the end of the path, we must come to the folder that we want to delete.

  6. Now we click on the address bar of the explorer (see screenshot) and copy the address (key combination "Ctrl + C").

Important! The method is applicable to any option: deleting a folder with or without confirmation - there is no difference.

Step 4. Paste the folder address into CMD. To do this, right-click next to the entered command on "Step 3"(unfortunately, the keyboard shortcut "Ctrl + V" in the command line does not work). We press "Enter".

Step 5. The utility will ask if you really need to delete the directory. If you are sure that yes - press the English key "Y", and then - "Enter".

Step 6. Ready! The folder has been deleted using the command line. Let's check the absence of the directory just in case.

Note! The folder is completely removed from the hard drive and does not fit into the "Trash"! Be careful using this tool - you can inadvertently delete important data from your computer permanently. Only the main user of the computer can delete a folder with administrator rights.

How to delete a file via command line

The principle of uninstalling a file is not very different from deleting a folder. We also need to find out the address of the file and register it in the CMD. The only difference is in the team itself.

Step 1. Open CMD.

Step 2. We drive in the following command: "DEL / F / S / Q / A". Then we put a space and paste the path to the file.

How do I find the path to the file?


Step 3. Paste the copied text into CMD (it must be in quotes).

Step 4. Now copy the file name from the field (along with the extension - see screenshot) and paste it into CMD.

Step 5. Close the quotes and press Enter.

Done - the file has been deleted permanently.

How to uninstall a program via command line in Windows 7

It happens that the program is not removed by the standard Windows application (from the Control Panel). To permanently remove the software, cleaning not only its files, but also the data in the registry, the command line is useful.

Step 1. Launch CMD.

Step 2. We drive in "wmic".

Step 3. Now you need to find out the names of a specific application in Windows, so as not to make a mistake and not remove useful software. To do this, we drive in "product get name" (literally - "get the name of the product").

Step 4. Uninstall the program from the command line. It remains only to drive in the text "product where name =" program name "call uninstall". The text in quotes is the name of the software from the list provided by the command line.

Step 5. Ready! You can check whether the software has been removed or not by going to the "Uninstall a program" application from the "Control Panel". If there is no software in the list, then the operation was successful.

How to switch to another drive in the command line

To navigate through directories and local drives, a familiar navigation tool is used - the explorer. However, with the help of CMD, you can go to directories located on the hard drive.

This instruction gives an answer to the question "how to switch to another folder in the command line", there is no fundamental difference between the directory and the local partitions of the hard drive.

Step 1. Launch CMD.

Step 2. We drive in the command "cd / d" d: "". In quotes - the address of our local disk or directory.

In the field, enter the command "cd / d" d: "", in quotes - the address of our local disk or directory, press "Enter"

How to make a bat file

Bat file - an algorithm that a user can write in the CMD utility. With regards to our topic, it is possible to delete the folder using the bat file command by entering a sequence of steps. Instructions for creating a BAT file:

Step 1. Create a simple document in Notepad.

Step 2. You can put several spaces or some kind of simple text. This is done so that the file is saved by the program (the main thing is that it is not empty). Now this does not play a big role, since we use the Notepad ++ utility to create a BAT file.

Step 3. Download Notepad. Install.

Step 4. We open our document.

Step 5. In the menu, select "Encodings" -> "Cyrillic" -> "OEM 866".

Step 6. Go to the "File" tab, select "Save As". We confirm the action and replace the old file with a new one.

Step 7. Now you can delete the old content of the file and drive in the desired algorithm.

Step 8. Save the document and change the extension from txt to bat.

Video - How to delete a folder using command line (cmd) in Windows

You can delete a folder by right-clicking on it and selecting delete from the context menu. But sometimes this method does not help and I cannot delete a folder, so I will describe several ways to delete a folder.

Delete a folder using the command line

To delete the Windows folder, do the following. Click "Start" - "All Programs" - "Standard" - "Command Line". A window will appear in which if you add Help and press "Enter", a list of commands and a description of each command will appear, the RMDIR command is to delete a folder through the command line. To learn how to write the command you need, for example, deleting a folder, you need to add Help RMDIR. The system told us how to write a command to delete a folder. RMDIR [drive:] path. I want to delete the remnants of the game paradise in the RAI folder and I got this command. RMDIR / S / Q C: \ Games \ RAI.

Delete folder via command line

Press "Enter" and the folder will be deleted immediately.

Delete folder using bat file command

So we figured out what the command for deleting a folder looks like. There are folders that appear again after a while. To remove them, you can create a BAT file on the desktop, because this folder that we do not need will be deleted when you run the bat file.

How to make a bat file

Right-click on an empty space on the desktop and select "New" - "Text Document" from the context menu. Open this text document that appears on the desktop. We enter the command RMDIR / S / Q C: \ Games \ RAI there, where C: \ Games \ RAI is the path to your folder. The entire path must be in English, since the bat file does not start if there are words in Russian in the written bat file. Now click "File" - "Save As". In the window that appears, write 1.bat in the file name line and click "Save".


In 1.bat rename the file

A sample bat file will appear on the desktop. Now run 1 bat file and delete the bat folder instantly.

Deleting the Windows old folder

Some people put the system by skipping disk formatting and they have a folder with old windows system files, usually called this Windows old folder. Many people don't know that the Windows old folder can be deleted. You can delete the old windows folder by cleaning the disk in Windows 7. Click "Start" - "All Programs" - "Accessories" - "System Tools" - "Disk Cleanup". A window will open in which you need to select the drive on which the Windows old folder is located and click "OK". The disk will be scanned and a window will appear in which we press "Clean up system files". In this window, put a check mark in the item "Previous Windows installations" and click "OK". A message will appear "Do you really want to permanently delete these files" click "Delete files".

Remove windows old

The system files are removed from the Windows old folder and now you can simply delete the Windows old folder.

Delete folder with administrator rights

Sometimes the folder is not deleted and the message "You need permission to perform this operation" appears and in order for the folder to be deleted, you need to allow full access in the folder properties for this, do the following. Right-click on the folder and select "Properties" from the context menu. Go to the "Security" tab and click "Advanced". In the new window, go to the "Owner" tab and click "Change".


We will change the owner of the folder

The owner window will open in which you need to select your administrator name (but not administrators), check the box "Change the owner of subcontainers and objects" and click "Apply".


Change folder owner

In the message that appears, we confirm and become the owner of this object. From the "Owner" tab, go to the "Permissions" tab and click "Change Permissions". In the window that opens, select the name of your administrator and click "Change". A window will open in which we put a check mark in the "Full access" item and click "OK" this window will close, and in the open window we put a check mark in the items:
"Add permissions inherited from parent objects."
"Replace all child object permissions with inherited permissions from this object" and click "OK".


Allow full access to the folder

Again, a message will appear with which we agree by clicking "OK" and close all windows by clicking "OK". The folder can now be deleted.

Deleting a folder in Total Commander

It is very easy to permanently delete a folder in Total Commander. You need to find the folder you need to delete and click on it with the left mouse button, and then click the delete button at the bottom of Total Commander or press F8 on the keyboard and a message will appear in which we click "Yes" or "Delete", depending on whether the folder is empty or what that is.


Search and delete empty folders in total commander

The folder will be deleted along with all its contents.

Program for forced deletion of folders

I like the Unlocker folder remover.

Install and the program for deleting non-removable folders will be in the context menu. Right-click on the folder to be deleted and select Unlocker from the context menu. A window will appear in which set the action "Delete" and click "Unblock all". The folder will be deleted.