I recently bought a new tower that has the Windows 10 OS on it. I am facing one issue with it right now.

Back in Windows 7 I was able to hide files and folders completely thanks to the CMD function attrib +h.

The files and folders in Windows 7 were hidden even though the show hidden files and folders option was ticked in the display section. However, this does not apply to Windows 10.

Did they change how the attrib function works for Windows 10 or am I doing something wrong?

  • NTFS doesn't have a mechanism to actually hide a file a user has permissions to read even if its hidden. – Ramhound Aug 23 '17 at 23:58
  • I was unable to reproduce in my Windows 7, Windows 8.1 or Windows 10 virtual machine. – Ramhound Aug 24 '17 at 0:01
  • That is very odd!.. I have been using Windows 7 and that old PC of mine for 9 years, and all the time I have been hiding personal files using the attrib function. I might add that I used "attrib +s +h" – Dean Aug 24 '17 at 0:03
  • So you set the system and hidden attribute. You either are either running as a user with elevated permissions or you didn't have the "show hidden files" enabled. In Windows if you have the permission to view the contents of a folder, and have read permissions on the file, you are going to be able to list the contents of that folder. It being hidden, which is a file attribute, isn't going to change that. – Ramhound Aug 24 '17 at 0:06

The file system architecture has not changed neither did attrib

Those files you had under Windows 7 were hidden because they had the 'Hidden' AND 'System' attribute, thus therefore you were not able to see them because "Hide protected operating system files" was enabled (by default). Now to be able to hide files on your current Windows OS with "Show hidden files, folders, and drives" enabled, those files must have the attribute 'S' and "H", as well as "Hide protected operating system files" enabled.

To assign a file as a hidden system file run this:

attrib +S +H MyFile.txt
  • Enabling "Hide protected operating system files" did the job for me, thanks! – Dean Aug 24 '17 at 1:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.