Examples, options, switches, and more

The delcommandis aCommand Prompt commandused to delete files.

Unlike deleting files normally, data removed with the del command doesn’t end up in Recycle Bin.

This command is the exact same as theerasecommand.

DEL command in Windows 10

It can also be used in Command Prompt in the Advanced Startup Options and System Recovery Options repair/recovery menus.

In Recovery Console in Windows XP and Windows 2000, thedeleteRecovery Console command can be used instead.

The availability of certain del command switches and other commandsyntaxmight differ fromoperating systemto operating system.

Delete All EXE Files

This one removes allEXEfiles from theTimuser’sDownloadsfolder.

The file extension could be replaced with * to delete every file from that folder.

Notice thereisn’ta space afterDownloads.

Adding a space would break the command and tell Windows to erase theDownloadsfolder instead of just the EXE files.

Similar to theio.syscommand above, this one would execute on whatever folder Command Prompt is set to.

Delete Files From Subfolders

This command will delete every file (*.

*) from every folder (/s) inside theAdobefolder in the user’sDocumentsdirectory.

The folders will remain, but every file will get removed.

Just like with the DOCX example above, the wildcard (*.

*) in this command can be changed to anything to remove only those files.

Use *.MP4 forMP4s, *.MP3 forMP3s, etc.

The commandforfilesis sometimes used with the del command to remove files that are so-many days old.

In MS-DOS, theundeletecommand is used to restore files that were deleted with the delete command.

To undo the del command in newer versions of Windows, try afile recovery program.