How to delete windows files

You might often find unwanted or unnecessary files and folders on your PC that you would want to get rid of. Deleting these files or folders helps to make an extra space on your PC which is always a good thing. In this post meant beginners, we will show you the different ways to delete files and folders in Windows 11/10, permanently or temporarily, by means of keyboard shortcuts, File Explorer, PowerShell, Command Prompt, specialized software, etc.

There are various ways by which you can delete Files and Folders, permanently or temporarily, in Windows 11/10:

  1. Using Context Menu – Right-clicking on the File or Folder
  2. Using Keyboard Shortcut – Delete key
  3. Using Keyboard Shortcut – Shift+Delete key
  4. Drag & Drop to the Recycle Bin
  5. Using File Explorer Ribbon
  6. Using PowerShell
  7. Using Command Prompt
  8. Using Specialized Software

Let us look at all of them in detail.

1] Using Context Menu – Right-clicking on the File or Folder

Windows 11

Cut, Copy, Paste, Rename, Delete, Share Windows 11

When you right-click on any file or folder that you want to carry out a Cut, Copy, Paste, Rename, Delete, Share, you will now no longer see any options mentioned in text.  What you will instead see are icons displayed on the top (or bottom) of the context menu as shown in the image above. These icons stand for:

  • Cut
  • Copy
  • Rename
  • Paste
  • Share
  • Delete.

You have to click on the Bin icon to delete the file or folder..

Windows 10

How to delete Files and Folders in Windows 10

To delete using the Context Menu, select the file(s) or the folder(s) you wish to get rid of. Right-click on it and press the ‘Delete’ option from the pop-up window that opens. The selected items are sent to the Recycle Bin as they are temporarily deleted and can be recovered if required.

Deleting a folder consisting of other files or folders will delete all that is inside that folder, so make sure you check properly before doing so.

2] Using Keyboard Shortcut – Delete key

While you are on your Desktop or File Explorer, select the items you want to delete and press the ‘Delete’ key or ‘Ctrl+D’ on the keyboard. This will temporarily delete the selected file(s) or folder(s) and will be moved to the Recycle Bin. However, these deleted files can be restored from the Recycle Bin.

To select all files in a folder, select ‘CTRL+A’.

3] Using Keyboard Shortcut – Shift+Delete key

To delete files or folders without sending them to the Recycle Bin, select the items and press ‘Shift+Delete’ on the keyboard. This will permanently delete the selected files. In such a case, these deleted files can only be recovered or restored using specialized software like Recuva.

TIP: Add Permanently Delete to Context Menu to Windows

4] Drag & Drop to Recycle Bin

How to delete Files and Folders in Windows 10

This is a simple method of deleting the file(s) or folder(s). All you have to do is select the file, and drag and drop it to the Recycle Bin.

5] Using File Explorer Ribbon

This method will teach you how to temporarily or permanently delete file(s) or folder(s) using the Home Menu from the File Explorer Ribbon.

To begin with, open File Explorer (Win+E) and navigate to the location of the files to be deleted. Tap or select the files you wish to get rid of and then.

In Windows 11 click on the BIn icon to delete the file or folder.

In Windows 10, click on the ‘Home’ tab in the Ribbon above.

How to delete Files and Folders in Windows 10

Further, press ‘Delete’ from the ‘Home’ tab, and you will see that a drop-down menu will open. Press ‘Recycle’ to temporarily delete the file, which will be moved to the Recycle Bin.

To permanently delete the files, select the ‘Permanently delete’ option.

How to permanently delete files and folders in Windows 10

A confirmation dialog box will appear asking if you are sure about permanently deleting this file. Click on ‘Yes’ to proceed.

6] Using PowerShell

If you are unable to delete a file or folder from your computer, you can use Windows PowerShell to delete any file and folder effortlessly. The advantage of using PowerShell is that you can force delete a file and remove all items from inside a folder.

7] Using Command Prompt

You can also delete files & folders using Command Prompt. using the DEL or RD commands.

8] Permanently Delete Files Using Specialized Software

There are specialized software that permanently delete unwanted files from your Windows 10 PC which cannot be recovered by any file recovery tools. Some of these data erasing apps are Eraser, WipeFile, Freeraser, File Shredder, Alternate File Shredder, and more.

You usually have to download and install these apps to use them. These apps permanently delete all the selected files and folders and cannot really be recovered by any specialized recovery tools.

These are all the possible ways to delete File(s) and Folder(s) in Windows 11/10.

Script examples to learn how to delete Windows files using the cmd prompt and the dir command.

To delete Windows files using a cmd script, it is recommended to use the del command. The del or delete command provides many very useful options to be in control of the deletion process. The Command Prompt is a text-based user interface that enables users to execute commands and perform scripted tasks with their computer.

It’s a powerful tool that can be used in a variety of ways. Users can use the Windows command prompt to recursively copy files, recursively delete files, manage the registry and much more.

1. Benefits of deleting files using the command prompt

Deleting files using the command prompt can provide several benefits over other methods. Firstly, it allows for faster deletion of multiple files or directories with a single command, reducing the time needed to perform the task. Additionally, the command prompt can be used to delete files that are otherwise difficult to delete using other methods.

For example, files with long file names, special characters or those that are locked by other applications can be deleted using the command prompt. Finally, using the command prompt can be more efficient for advanced users who are familiar with command line interfaces and prefer to use them over graphical user interfaces.

In this article, we will show you how to delete files with the Windows command prompt and why you should start using it. It’s also an easy way to execute commands without using the graphical user interface (GUI). The cmd is a part of the administration commands available in MS systems. To delete a file with cmd, you need to provide the exact path of the file.

If you don’t know where the file is located, you can use the dir command to locate it. The main option that we suggest using is the deletion confirmation, which allows you to control one last time which file to delete. However, please note that the files deleted with the del command line are not stored in the Recycle Bin, so you cannot restore them.

Make sure you delete the proper file. The delete operation is irreversible.

2. Command line script to delete files the simple way

Deleting files through the command prompt can be done in a variety of ways, with varying levels of confirmation prompts and complexity. One simple way to delete a file through the command prompt is to use the “del” command with the explicit file path. This command will delete the file without any confirmation prompts, so it’s important to double-check the file path before executing the command.

Here is an example of how to use this command to delete a file with the path “C:\Folder\file (1).txt”.

del "C:\Folder\file (1).txt"

Keep in mind that this command will permanently delete the file without moving it to the Recycle Bin, so use it with caution.

3. Delete files with a confirmation prompt

When deleting files with the command prompt, it’s important to exercise caution and double-check the filename before proceeding with the deletion. One way to ensure this is by using the confirmation prompt option. To delete a file with confirmation, you can use the “/p” option followed by the file path. For example, to delete a file named “file (2).txt” located in the “C:\Folder” directory, you can use the command “del /p “C:\Folder\file (2).txt””.

This will prompt a confirmation message asking if you want to delete the specified file. If you confirm the deletion by pressing “Y”, the file will be permanently deleted. Useful for example to delete a file and make sure to double check the filename.

del /p "C:\Folder\file (2).txt"

Then a prompt is displayed:
C:\Folder\file (2).txt, Delete (Y/N)?

Image with screenshot how to delete a file in windows cmd.

Screenshot of Windows command prompt of file deletion a file in cmd.

4. Use the delete command without confirmation

The other way to delete Windows files with cmd is to disable the confirmation for a large number of files for example. Indeed, if you want to delete multiple files without being prompted for confirmation at all, you can use the delete command in quiet mode.

This mode disables the confirmation prompt and deletes files directly. To use this mode, you can type “del /q” followed by the path and name of the file you want to delete. For example, to delete a file named “file (3).txt” located in the “C:\Folder” directory, you can use the following command.

del /q "C:\Folder\file (3).txt"

5. Delete read only files in command line with force option

When trying to delete a read-only file, the command prompt may display an error message that says:

Access is denied.

This is because the file is set to read-only. To bypass the read-only attribute and force the deletion of the file, you can use the del command with the /f option. For example, to delete a read-only file located in “C:\Folder” named “file (3).txt”, you can use the following command: “del /f C:\Folder\file (3).txt”. This will delete the file without any error messages or prompts.

So, to force deletion of a read only file, and bypass the read-only attribute, use the del /f option, /f stands for force.

del /f "C:\Folder\file (3).txt"

Conclusion on Windows files deletion and its options

To conclude, the “del /p” option is definitely the best cmd option to make sure to delete the proper files from the disk. Use it when only when deleting specific and targeted files. However, to delete a large number of files, use the quiet and the force options.

To delete Windows files using cmd, the command prompt definitely provide several benefits over other methods, i.e. mainly the Windows GUI. It allows for faster deletion of multiple files or directories with a single command, reducing the time needed to perform the task. Additionally, the command prompt can be used to delete files that are otherwise difficult to delete using other methods. The command prompt is a text-based user interface that enables users to execute commands and perform scripted tasks with their computer.

Finally, using the command prompt can be much more efficient for advanced users who are familiar with command line interfaces and prefer to use them over graphical user interfaces. Check out how to copy a file to another folder in command line.

This basic guide describes in detail how to delete a file (folder) in Windows (several ways): from simple deletion to guaranteed deletion with protection from data recovery programs.

Contents

  1. Delete file to “Recycle Bin”
  2. Permanent delete
  3. Guaranteed file deletion
  4. Delete via Command promt
  5. Delete via PowerShell
  6. Comparison table

Article in other languages:
?? – Cómo eliminar un archivo en Windows (varias formas)
?? – Как удалить файл в Windows (несколько способов)

Delete file to “Recycle Bin”

? To select multiple files or folders, hold the special button and press the left mouse button:

  • Сtrl — highlight a specific file or folder;
  • Shift — selection of a range of files or folders.

How to delete a file (folder) using the menu

  1. Right-click on a document or folder;
  2. Select the Delete item;
  3. Click Yes in the confirmation request.

How to delete a file in windows

The file will be deleted to the Recycle Bin.

How to delete a file (folder) using the button

  1. Highlight a document;
  2. Press the Del key;
  3. Click Yes in the confirmation request.

The file will be deleted to the Recycle Bin.

Disable (enable) delete confirmation

  1. Click on the Recycle Bin can icon with the right mouse button;
  2. Select Properties;
  3. Disable the Display delete confirmation dialog.

Recycle Bin display delete confirmation dialog

? If you just deleted the desired file, press the key combination Ctrl + Z. This will undo your last action in Windows, the deleted file or folder will return to its place.

How to recovery files from Recycle Bin

  1. Open the Recycle Bin;
  2. Select the desired file or folder;
  3. Right click on the selected file;
  4. Select Recover.

Recycle Bin restore files and folders

Restore files

The file will be restored to the folder from which it was deleted.

You can transfer the file (or folder) from the Recycle Bin to the folder you need.

Click and hold the left mouse button on the selected file and drag it to the folder or Desktop you need.

How to empty Recycle Bin

You can delete all files from the Recycle Bin.

  1. Click on the Recycle Bin with the right mouse button;
  2. Click Empty Recycle Bin.

Empty Recycle Bin

Empty Recycle Bin

? This is a permanent data deletion!

How to permanent Delete

  1. Highlight a file or folder;
  2. Press the key combination Shift + Del;
  3. Click Yes in the confirmation request.

how to permanently delete file (folder) in windows

Permanently delete folder

? This is a permanent data deletion!

Guaranteed file deletion

Guaranteed deletion of data on the active disk

For guaranteed data deletion, we use the standard CIPHER utility.

Cipher.exe is a command-line tool (included with Windows 2000) that you can use to manage encrypted data by using the Encrypting File System (EFS)

Microsoft support

? To overwrite as much data as possible, it is recommended that you close all other applications while running CIPHER / W.

  1. Run the command prompt as administrator;
  2. We launch the CIPHER command with the necessary keys.
cipher /W:X

/W — key, deletes data from available unused disk space in the entire volume. The content is overwritten in three stages, with values: 00, FF and a random number.

:X — work volume label.

Guaranteed file deletion - cipher utility

Utility Cipher.exe

? Using the CIPHER utility – this is guaranteed data deletion!

Guaranteed data deletion on inactive devices

For guaranteed data deletion on inactive devices: unused hard disks, portable hard disks and flash devices, we use the standard FORMAT utility.

  1. Run the command prompt as administrator;
  2. We start the format command with the necessary keys.
format X: /P:count

X – specifies the drive letter (followed by a colon), mount point, or volume name.

/P:count — zero every sector on the volume. After that, the volume will be overwritten “count” times using a different random number each time. If “count” is zero, no additional overwrites are made after zeroing every sector.

To run the utility successfully, you must enter the correct label of the active volume/device.

Guaranteed file deletion format

Utility Format.com

The process can take a long time, especially if a large number is indicated in the rewrite counter.

? Using the FORMAT utility – this is guaranteed data deletion!

Delete via the Command prompt

How to delete a file via command prompt

  1. Run the command prompt;
  2. Go to the desired folder (cd command);
  3. Run the del command and the fully qualified file name with the extension.
del mydoc.txt

Delete files via command prompt

If there are spaces in the file name, enclose the name in quotation marks.

To delete files from system directories, you must run the command prompt as administrator.

? This is a permanent data deletion!

How to delete a folder via command prompt

  1. Run the command prompt;
  2. Go to the desired folder;
  3. Run the RD command.
rd "folder name" /S

Delete folders via command prompt

/S – removes all directories and files in the specified directory in addition to the directory itself. Used to remove a directory tree.

If there are spaces in the directory name, enclose the name in quotation marks.

To delete directory from system directories, you must run the command prompt as administrator.

? This is a permanent data deletion!

Delete via PowerShell

The PowerShell command to delete folders and files is Remove-Item.

The synonyms of the Remove-Item command are: del, erase, rd, ri, rm and rmdir, so commands from the Windows command prompt will also work.

 Remove-Item "X" -Recurse

PowerShell delete files and folders

Windows PowerShell

X – full path to the file (with extension) or folder.

Recurse – the key indicating the deletion of the content folder.

? This is a permanent data deletion!

Comparison table of options how to delete a file

Comparison table on how to delete files and folders.

Deleting data to the Recycle Bin Deleted data can be restored from the Recycle Bin folder on the Desktop.
Permanent data deletion Deleted data can only be restored using special programs.
Guaranteed data deletion Deleted data cannot be recovered even by special data recovery programs. But special services and laboratories can still recover deleted data.

How to delete a file (folder) in Windows was discussed in this article. I hope that now you can delete files or folders in different ways, including guaranteed deletion of files beyond recovery with special programs. However, if you run into any problems, do not hesitate to write in the comments. I will try to help.

Hello guys, Here I come with a fascinating and common topic: “How you can delete undeletable files or folders in Windows 11/10.” I am sure all of us have faced this problem in our life.

This error occurred because of malware, spyware, adware, and some system program. Because sometimes our computer system uses our file in the background, that why we can’t be able to delete those files or folders.

Always try to clean junk files from your system or irrelevant files that occupy unnecessary space on your system. So let’s check how we can deal with this problem. I’ll provide you with the best methods that are useful and working.

Method 1: Using Command Prompt

Command Prompt is a fantastic tool in windows that can fix most of your problems with just a command. Today, in this method, we will guide you on how you can fix undeletable file issues.

Before we run commands, you must restart your computer because there is a strong possibility that your file location might be in use by the windows program.

So whenever we restart our computer, all programs which run in the background are stopped. After the restart, browse your file location and delete the file or folder. If the problem continues, then follow our below steps.

Step 1: Open “Command Prompt” Option

There are two ways to open a command prompt. The first is that you can click on the start button and type “CMD” or “Command Prompt” in the search bar, or you can press “Window key + R” and type “CMD” “Command Prompt” without any quotation marks.

Step 2: Run as an Administrator

This step allows those are using the first option to open “CMD” or “Command Prompt.” So when you write “CMD” in a search bar, it will show you the cmd option. Right-click on it and choose the run as administrator option.

Note: This method will not work if you don’t run Command Prompt in Administrator mode.

Step 3: Type the Command

The black window will pop up on your computer, where you will type your command. The command is “del /F /Q /A C:\\users\\Your username\\ your file location\\ Name of the file you want to delete.”

Let me explain these commands, meaning simply.

  • /F – The meaning of F is “Force deleting of read-only files.”
  • /Q – Q stands for “Quiet Mode,” which means the computer will never ask anything when you click ok to delete.
  • /A – A stand for “Select files to delete.”
  • C:\\users\\ – type this command because we all know C is the main part of a computer where C drive contains the operating system and all the files of the window, which helps run the window.
  •  Your Username\\ – Here, you need to type your computer user name, for example- “Bisht Family” this is my username, and you also get an idea from the above image.
  • Your file location\\ – I think most of you have already understood, but if some are confused, then don’t worry. See, you have to type your file location, for ex- “Desktop,” as you can see on the above image, so if your file is somewhere else, then type that name.
  • Your Filename – The last step where you type your file name, which you want to delete. For example, if your filename is “sample.txt” in Drive Z, you must type “del /F /Q /A Z:\\sample.txt”.

Step 4: Hit Enter

The last and straightforward step is “hit Enter” after tying all the commands correctly, you need to press the enter button, and your folder or file will be gone forever.

Delete a Folder That Won’t Delete in Windows 7/8/10 (Video Tutorial)

Method 2: Using an Unlocker Application

Using an application is the easiest way to delete the undeletable file or folder in a second. Don’t worry if you face this problem and want to delete the folders.

You have to download an application that will help you to delete the undeletable folders. But the main point is which software is good for this, so don’t worry, follow the below steps. And you will delete folders from your computer.

Step 1: Download an Application

There are many applications on the internet for deleting a malware folder from the computer. We are using Unlocker because this application is safe for use.

If you need more options, research on the internet; many more options are available, like BitRaser, File Assassin, and Lock Hunter.

Unlocker Download link: Click for Download Unlocker

Step 2: Run the application

Now double-click on the application to install. After installing, simply click on the icon. The application will show you a pop-up box that asks you to Browse the files or folders you want to delete.

Step 3: Delete the file from your computer

If you select the folder you want to delete, select the action you want to perfume and click ok.

So this is how you can delete all undeletable files and folders on windows 11/10. We know how irritating these undeletable folders can get. So don’t worry now. Please share this article with your friends who might get benefit from it. Please bookmark our site for more such articles.


Download Article


Download Article

Deletion is a process that makes files inaccessible to most users, including yourself. Deleting files is very simple on a computer.

  1. Image titled Delete a File On Your Computer Step 1

    1

    Locate the file to be deleted. Browse File Explorer, and once you find the file to be deleted, right click, and click on «Delete», or press the Delete key, or drag the file to the Recycle Bin.

    • Provide confirmation if needed.
    • Hold Shift to permanently delete the file.
  2. Image titled Delete a File On Your Computer Step 2

    2

    Permanently delete the file. In the Recycle Bin, right-click, choose «Delete», and confirm that you want to permanently delete the file.

    • To empty the Recycle Bin, right-click on the Recycle Bin, choose «Empty Recycle Bin», and provide confirmation, or under Recycle Bin tools, choose «Empty Recycle Bin».
  3. Advertisement

  1. Image titled Delete a File On Your Computer Step 3

    1

    Know the file you want to permanently delete. This method deletes the file permanently, so be careful with it.

  2. Image titled Delete a File On Your Computer Step 4

    2

    Open Command Prompt. Press Win+X. Then choose «Command Prompt».

  3. Image titled Delete a File On Your Computer Step 5

    3

    Type the following command: del/ erase filepath. This will permanently delete the file. If you choose to delete a folder, type -s at the end of it to delete all of the subdirectories.

    • Be careful what you delete; running this line with C:\ as the filepath will wipe your entire C drive (the drive with Windows on it).
  4. Advertisement

  1. Image titled Delete a File On Your Computer Step 6

    1

    Locate the file to be deleted. Browse using the built-in Finder.

  2. Image titled Delete a File On Your Computer Step 7

    2

    Right click on the file. Then click «Move to Trash».

  3. Image titled Delete a File On Your Computer Step 8

    3

    Empty the Trash. Right-click on the Trash icon, then choose «Empty Trash». This will permanently delete all of the files moved to it.

  4. Advertisement

  1. Image titled Delete a File On Your Computer Step 9

    1

    Know the file you want to permanently delete. This method deletes the file permanently, so be careful with it.

  2. Image titled Delete a File On Your Computer Step 10

    2

    Open Terminal. Find it on your dock, or search for the app name.

  3. Image titled Delete a File On Your Computer Step 11

    3

    Type the following command: rm filepath. This will immediately delete the file permanently.

    • If you want to delete a folder, use rm -rf filepath instead. This will delete all of the subdirectories as well.
    • Use sudo to delete files you do not have permission to delete. Be very careful what you enter there, as it only takes eight bytes of code to wipe your whole hard drive.
  4. Advertisement

Ask a Question

200 characters left

Include your email address to get a message when this question is answered.

Submit

Advertisement

  • If you accidentally deleted a file, you can restore the file from the Recycle Bin/Trash/Recently Deleted. Go there, select the file, and choose «Restore» or «Recover».

Thanks for submitting a tip for review!

Advertisement

  • In some cases, file deletion is permanent. Be careful with what you delete on what device.

  • Beware of internet trolls that tell you to delete crucial files for your computer. Everything outside of the Users and Program Files/Applications folder are important files needed to keep your operating system running. Don’t delete System32, and don’t delete your hard drive.

Advertisement

About This Article

Article SummaryX

1. Click and hold the file.
2. Drag and drop the file over the Trash/Recycle Bin.
3. Empty the Trash/Recycle Bin by right-clicking on it and choosing Empty Recycle Bin or Empty Trash.

Did this summary help you?

Thanks to all authors for creating a page that has been read 30,738 times.

Is this article up to date?

  • How to downgrade windows 11 to windows 10
  • How to delete windows defender 10
  • How to connect ubuntu to windows
  • How to change user folder name windows 11
  • How to disable windows update in windows 10