Danger: Hidden Files Aren't Really "Hidden"

Share

On Windows, it's possible to mark a file or folder as "hidden" in the file properties dialog. Doing so will turn it into a "hidden file," which apparently disappears from the folder where it was placed, despite still existing there. While this is pretty neat, it may mislead you into a false sense of security. You may think that, if you want to hide some files in your computer, you can just mark them as hidden, and that's it. However, hidden files aren't really "hidden."

A hidden file is only "hidden" in the File Explorer when it's not configured to display hidden files. This means that hiding a file will hide it from non-technical users who don't understand the concept of hidden files, but anyone tech-savvy enough can find your hidden files.

On top of that, when you hide a file but File Explorer is configured to display them, hidden files are displayed semi-transparently, which means anyone will be able to tell that you tried to hide those files specifically. It's going to put a huge target on the very files you tried to hide.

A dialog titled "New Text Document Properties." It has 5 tabs: General (active), Digital Signatures, Security, Details, Previous Versions. The first field, unlabeled, has the value New Text Document. To its left an icon of a document. Type of file: Text Document (.txt). Opens with: Notepad (a button "Change..."). Location: C:\Users\en\Documents. Size: 0 bytes. Size on disk: 0 bytes. Created: Friday, January, 2025, 11:29:54 AM. Modified: (same date). Accessed: 3 minutes ago. Attributes: two checkboxes, Read-only and Hidden, both unchecked. A button reads "Advanced..." At the bottom, three buttons: OK (with a blue outline), Cancel, Apply (greyed out).
The file properties dialog for a new text document on Windows 11. Observe the option to mark a file as "Hidden" at the bottom.

Hiding Requires Additional Programming

By default, when a program asks the operating system to tell what files are contained in a folder, the system will just give them all the files, no matter if they are hidden or not. This means it requires additional programming to hide files that are marked as hidden.

Some simple programs that list files in folders will actually just display all files, even those that are marked as hidden. Note that this is very unusual. To begin with, most applications don't even have custom programming to list files. If they need to browse files, for example, they will use a subprogram that already exists in a common toolkit, and these toolkits take care of technicalities such as hiding files. That's why every dialog to open a file or save a file looks exactly the same. They're all using the same subprogram. However, if an application has its own custom dialog for some reason, it's possible it doesn't contain the programming to hide hidden files on Windows, specially if it's an application created by a developer who uses Linux, a system where the concept of hidden files doesn't really exist.

Hidden Files aren't Hidden From Programs

Hiding a file does nothing to stop a program from opening the file. The only thing hiding a file does is prevent a file manager that supports the concept of hiding files from listing the file. When a file inside a folder is hidden, and you open the folder in a file manager, it's going to list all files in that folder except the hidden files. That's all it does.

Applications open files by their filepaths. This means even if a file is hidden, and you can't see it, you can still open the file so long as you have its filepath.

For example, some applications keep a list of recently opened files, which means they keep a list of recently opened filepaths. If you make a recently opened file "hidden," you can still open the file through the recent files list because the application will just try to reopen a filepath that was previously opened in the application.

Additionally, if the application has a typical open file dialog, you can simply type the absolute filepath of the hidden file in the filename field and click Open to open it, even if it's hidden. For example, if you have a cat.jpg file hidden in C:\photos, you can just type C:\photos\cat.jpg and press Open to open it. Applications don't really check if files are hidden or not before opening them, and the system won't check either.

A file manager can also display a hidden folder if you type its filepath in the address bar. For example, if you have a hidden folder called hidden photos inside C:\photos, you can type C:\photos\hidden photos in the address bar and the file manager will simply display the folder just like any normal location. If the files inside the folder are hidden, the file manager won't list them, but if only the folder itself is hidden and its files are not hidden, they will be displayed just like normal.

Hidden Files on Windows aren't Hidden From Linux

Even if there was a way to perfectly hide a file on Windows, the file still wouldn't be hidden if you access the filesystem from a different operating system like Linux. Similarly, you don't even need your password to access your personal files (e.g. my documents, my pictures, etc.).

The password on Windows only prevents someone from starting programs in Windows as a certain user, which in turn prevents them from access personal files of that user. If you access the filesystem from Linux, you don't need any Windows user password to just view every Windows user files.

How to Hide Files Correctly?

The only secure way to hide files is to encrypt them. But encrypting is a hassle, and there is a good chance you will lose the files you tried to hide if you lose the key used to encrypt the files.

If you have files in your computer that you don't want other people to see, just don't let them touch your computer.

If you have to share your PC with other people but you want to keep your files private from them, just create a second Windows account for them and put a password on yours. That won't stop someone who knows how to get around this, but it will stop 99% of the world, which is probably good enough.

If creating a secondary account isn't possible for some reason (note: you can easily log out and switch accounts on Windows without turning off the computer. It takes three clicks, so I'm not very sure how this isn't possible), then using the "hidden" files is your only option. Once again, this will work on 99% of the world.

However, do note that, as mentioned previously, applications will keep track of your recently opened files, so if you need to share your main Windows account with someone else, but you absolutely don't want them to touch your private files, and you also can't supervise them while they are on your PC for some reason, an alternative is for you to create a secondary account for yourself where you put the stuff you want to hide, and only let them use your main account.

One importante note: because hidden files and folders are just normal files and folders, they WILL be deleted if someone deletes the folder where they are contained. It won't matter if they are hidden or not. If someone deletes all your documents, it's all gone. Similarly, if someone copies the whole folder, they will also copy any hidden files inside the folder even if they aren't aware of their existence. If you have files important and personal enough for you that you need to hide them, you really shouldn't let other people touch your computer without your supervision.

Written by Noel Santos.

About the Author

I'm a self-taught Brazilian programmer graduated in IT from a FATEC. In a world of increasingly complex and essential computers, I decided to use my technical expertise in hardware, desktop applications, and web technologies to create an informative resource to make PC's easier to understand.

View Comments