How to Delete a File in Windows (several variants)

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 BinDeleted data can be restored from the Recycle Bin folder on the Desktop.
Permanent data deletionDeleted data can only be restored using special programs.
Guaranteed data deletionDeleted 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.

Leave a Comment