How do I delete hidden files?
A hidden file is often hidden because it contains information essential to the operation of the operating system or a program. They are hidden to prevent accidental deletion by a user, which can adversely affect a software program's performance and usage. If you still want to delete a hidden file knowing why it may be hidden, below are the steps you can follow to delete hidden files.
Show hidden files in Windows
In Windows and most operating systems to delete a hidden file, you must have show hidden files enabled to know the file exists. Without being able to see the file, it cannot be deleted. In Windows, when show hidden files are enabled any hidden icon will appear as a faint or ghost icon.
Once hidden icons are visible, you can delete a hidden file like any other file on the computer. For example, in the above listing, there are three files, the "hidden.txt" is the hidden file and as can be seen is much lighter than the other two files. If you selected this file and press the delete key, that file would be deleted.
Show hidden files in the Windows command line
From the Windows command line or any MS-DOS prompt, you can show hidden files by using the attrib command. To display all files including hidden files type attrib and press Enter to return results similar to the example below.
A H C:\hidden.txt
Any hidden file has an "H" file attribute next to it. In the above example, "hidden.txt" is the hidden file. Before that file can be seen and deleted, unhide the file by typing the following command.
attrib -h hidden.txt
Delete the folder
In earlier versions of Windows (e.g., Windows XP), pressing Ctrl+A (to select all files) would give you the prompt "The folder contains 1 hidden files. If you want to select these files as well, enable show hidden files." which lets the user know there are hidden files that could also be deleted. However, after all the files have been deleted pressing the delete key will not delete the hidden file.
Later versions of Windows (e.g., Windows 7 and Windows 8) give you no notification if there are hidden files when pressing the Ctrl+A shortcut key.