Windows Hidden Attribute showing how Windows hides files and folders in File Explorer

The Hidden Attribute: How Windows Hides Files and Folders

Introduction

Welcome to Systematic Mode!

Has this ever happened to you? You plug in your pen drive, open it in File Explorer, and find that it appears completely empty. You know your data is there; even the used space indicates that data is stored on the drive. Your first guess is that the data is hidden, so you enable the option to show hidden files and folders. And still, the pen drive shows nothing.

At this point, several possibilities might come to mind: a Windows problem, a faulty pen drive, or maybe a virus. One thing, however, makes the situation puzzling: the drive still shows that space is being used, suggesting that the data may still be there, even though you cannot see it.

In this lesson, we’ll investigate this puzzle by exploring the Hidden attribute, one of the file attributes Windows uses to control the visibility of files and folders.

In our previous lesson on File Explorer Options, we covered the “Hidden files and folders” setting with some basic practicals. Today we go much deeper, starting from the fundamentals and moving up to advanced use. Along the way, we’ll recreate this pen-drive scenario and work through it step by step.

What You’ll Learn

  • What the hidden attribute is and where it lives
  • How the Hide/Show setting works across Windows versions
  • Hiding and unhiding files and folders in practice
  • Using the attrib command to read and change attributes
  • Recreating the “empty” pen drive case and recovering the files
  • How the System attribute differs from Hidden
  • Why hidden does not mean secure

Before we start the practicals, let’s first build a clear understanding of what it means for a file or folder to be hidden.


Part 1: Understanding the Hidden Attribute

Before touching any setting, it helps to know what “hidden” actually means in Windows. This part covers what a hidden item is, the attribute behind it, where that attribute is stored, and why Windows uses it.

1.1 What Is a Hidden File or Folder?

When someone says a file or folder is hidden, it simply means that Windows is not showing it in the normal view. The item is still present on the drive, but File Explorer (and many other programs) choose not to display it by default.

A common misconception is that Windows moves the hidden file to some secret location, puts it in a special protected folder, or treats it as a completely different kind of file. None of this is true.

The file or folder remains exactly where it was. Its name, content, size, and location do not change. The only difference is a small instruction that tells Windows: “Do not show this item in the normal view.”

That instruction is called an attribute.


1.2 What Makes a File or Folder Hidden?

In Windows, files and folders can carry various attributes that define certain characteristics or behaviors. One of these attributes is the Hidden Attribute.

The Hidden attribute is the switch behind everything in this lesson:

  • When it’s on, File Explorer leaves the item out of the normal view by default.
  • When it’s off, the item is shown like any other.

An important thing to understand is that the Hidden Attribute is exactly what its name suggests: an attribute, not a file type.

For example, a text document does not become a different kind of file when it is hidden. A folder does not become a special Windows folder when it is hidden. The item remains the same; only one of its properties changes.

Important: Hidden files and folders are not moved to another location, nor are they converted into a different type of item. The Hidden Attribute only affects how Windows displays them.

The Hidden Attribute can be applied to both files and folders, which means that it is not limited to documents or specific item types.


1.3 Where Is the Hidden Attribute Stored?

In Windows, the hidden attribute is stored as part of a file’s or folder’s properties. That’s why it stays with the item when you copy it to another Windows drive.

You can view it by opening the item’s Properties window and looking under the General tab.

General tab of a folder’s Properties window with the Hidden check box highlighted.

The presence of this checkbox confirms that the Hidden Attribute is attached directly to the file or folder itself.

The Hidden attribute is also not limited to documents or folders. It can be applied to different types of files, including compressed archives, disk images, and executable setup files.

The hidden checkbox is showing on different file types, like ISO, RAR, and media player setup.

As these examples demonstrate, the Hidden Attribute is a property that can be applied to a wide range of files and folders.


1.4 Why Does Windows Hide Certain Items?

Windows sets the Hidden attribute on some items by itself, and you’ll see examples in the practicals later. It does this for several practical reasons:

  • Keeping everyday folders uncluttered. You rarely need to see everything an app or Windows stores.
  • Reducing accidental changes. Items that ordinary users rarely need to touch are less likely to be deleted or edited by mistake.
  • Keeping app and system information out of the way. A good example is the AppData folder inside your user folder, which stores app settings and profile data.

Windows also has a stronger form of protection for very important system files. This involves another attribute called the ‘System attribute’, along with a separate setting in File Explorer. We will examine that in detail later in the lesson.

Windows provides two main ways to control the visibility of hidden items: a simple graphical setting in File Explorer Options, and a more powerful command-line tool called attrib. In the next part, we will first look at the graphical method.


Part 2: Working with Hidden Files and Folders

In this part we move from theory to practice. You’ll find where the Hide/Show setting lives, hide and unhide files and folders yourself, and test how hidden items behave when you copy, search for, and open them. We finish with a case where the Hidden attribute isn’t available at all.

Note for readers coming from the previous lesson:
In our File Explorer Options lesson we already tried the Hide/Show setting in a few quick practicals, so some of what follows may feel familiar. This part goes into much more detail, so keep an eye on the repeated steps, because new findings are mixed in along the way.


2.1 The Hide/Show Setting

Windows gives you two ways to control whether hidden items appear in File Explorer: the Hidden files and folders setting in File Explorer Options, and a quick toggle in File Explorer’s View menu. By default, Windows is set to not show hidden items.

Method 1: File Explorer Options

Open File Explorer, click the See more (…) menu, select Options, and switch to the View tab. Under Advanced settings, find the Hidden files and folders group. It has two options:

  • Don’t show hidden files, folders, or drives (the default)
  • Show hidden files, folders, and drives
File Explorer’s See more menu with the Options item highlighted and View tab of File Explorer Options with the two Hidden files and folders options.

You can also open the same dialog from the Run box. Press Win + R, type control folders, and press Enter.

Run dialog with the command control folders entered.

There are other ways to open File Explorer Options, such as Start menu search or Control Panel, which we covered in our File Explorer Options lesson.

Method 2: The quick toggle

In File Explorer, click View → Show → Hidden items. A tick means hidden items are shown, and no tick means they’re not.

Hidden items quick toggle shows in file explorer windows.

Both methods control the same setting and stay in sync: change one, and the other updates immediately.

Note:

  • In every Windows version from XP to Windows 11, the main place for this setting is the dialog now called File Explorer Options. In older versions it’s called Folder Options, as explained in our File Explorer Options lesson.
  • The quick toggle first appeared in Windows 8, as a Hidden items check box on the ribbon. In Windows 11 it’s a menu item with a tick.

Observation: during testing in virtual machines I observed this behavior, but did not find any official documentation, so it is marked as an observation rather than a confirmed fact.

Now that we know where these settings are, let’s use them to hide and unhide files and folders.


2.2 Hiding and Unhiding a File

Let’s start with the simplest case: hiding a single file. For testing, I have several kinds of files in drive E: a PDF, a Notepad file, an Excel sheet, and a RAR archive.

Drive E showing a PDF, a Notepad, an Excel and a RAR file

We’ll hide the Notepad file first. Right-click it and select Properties. The General tab opens by default, so just tick the Hidden check box. Ticking it changes nothing yet. The attribute is only applied when you click Apply or OK.

Properties window with the Hidden check box ticked and the Apply button highlighted

Click Apply, and the file disappears from the folder right away. Then click OK to close the window.

Drive E file list without the Notepad file.

That’s all it takes. The file is hidden because Windows is currently set to Don’t show hidden files. Let’s change that setting and see what happens. I’ll use the quick toggle: View → Show → Hidden items.

File list with the Notepad file showing a faded icon next to the other files

The Notepad file now appears among the other files, but its icon looks faded. That’s how Windows marks an item as hidden while hidden items are being shown.

Showing hidden items doesn’t remove the attribute. If you open the file’s Properties again, Hidden is still ticked. The setting only controls whether Windows displays hidden items, and the attribute stays on the file until you change it yourself.

Properties window showing the Hidden check box still ticked.

That’s also why the attribute normally goes with the file when you copy it to another drive or computer, while whether it’s visible there depends on that computer’s Hide/Show setting. We’ll test this later in this part.

Hiding works the same way for any file type.

To unhide a file, you first need to be able to see it, so hidden items must be shown. Then open the file’s Properties, untick Hidden, and click Apply and OK.

Properties window with the Hidden check box unticked and the Apply and OK buttons highlighted

The icon is now fully visible.

File list with the Notepad icon in full color and the PDF and RAR icons faded.

A folder adds one extra prompt when you hide it, so let’s see how that changes things.


2.3 Hiding and Unhiding a Folder

Hiding a folder works like hiding a file, with one extra step when the folder has items inside. For this practical I have several folders in drive E. First I’ll hide Testing Folder 1, which contains some files and a subfolder.

Testing Folder 1 open in File Explorer with several files and a subfolder

Hiding a folder: this folder only

Right-click Testing Folder 1, select Properties, tick Hidden, and click Apply.

Folder Properties window showing the Hidden checkbox enabled.

Unlike the individual file demonstration in the previous subsection, clicking Apply here opens an additional window called Confirm Attribute Changes.

Confirm Attribute Changes window displaying two available options.

Confirm Attribute Changes appears whenever you hide a folder. It shows the change you’re making and asks how far it should reach:

  • Apply changes to this folder only
  • Apply changes to this folder, subfolders and files

We’ll try both. First, select Apply changes to this folder only, click OK, and click OK again on the Properties window.

Testing Folder 1 disappears from drive E, because the Hide/Show setting is currently set to not show hidden items.

Drive E file list with Testing Folder 1 missing

Now switch the setting to show hidden items (steps in 2.1) and see what changed.

Testing Folder 1 with a faded icon among normal icons. Inside the testing folder 1, the files and subfolder showing normal icons.

The folder icon is faded, just like the Notepad file in 2.2. The items inside it are not. That’s because we applied the attribute to the folder only.

Hiding a folder: subfolders and files

Now, we’ll apply the attribute to everything inside the folder. Since the folder is already hidden, its Hidden box is ticked. To re-apply the attribute, first untick Hidden and click Apply. Because the folder contains items, the Confirm Attribute Changes window appears. Select either option and click OK. Then tick Hidden and click Apply again, and this time choose Apply changes to this folder, subfolders and files.

Confirm Attribute Changes with the second option selected

The attribute is now applied to the folder and everything currently inside it.

Testing Folder 1 opened, with every item showing a faded icon

Every item inside is faded now. To confirm, right-click the subfolder and open its Properties.

Properties window of the subfolder with the Hidden check box ticked.

We never ticked Hidden on this subfolder ourselves. It was applied automatically by the second option.

Note: There’s one thing about this second option that’s easy to get wrong. We’ll test it in practice at the end of this section, in Items added later aren’t hidden.

Unhiding a folder

The process of unhiding a folder is similar. First, make sure Hidden items is enabled so that you can see the hidden folder. Then right-click Testing Folder 1, open Properties, and clear the Hidden checkbox. Click Apply.

The same Confirm Attribute Changes window appears, first choose Apply changes to this folder only, click OK, and click OK again on Properties.

Unticked Hidden check box with the Confirm Attribute Changes window open.

The folder returns to a normal icon, but the items inside are still faded.

Testing Folder 1 at normal color while the items inside remain faded

Because we unhid only the folder, the attribute is still on the items inside. The PDF’s Properties window shows Hidden ticked.

PDF Properties with the Hidden check box ticked.

To unhide the items inside, repeat the steps and choose Apply changes to this folder, subfolders and files. Or you can select individual items and unhide only those, or several at once, as we’ll see later in this section.

Empty folder behavior

Every folder we’ve hidden so far had something inside it, and an empty folder behaves differently. I’ve created a new empty folder. Right-click it, open Properties, tick Hidden, and click Apply.

Properties window of an empty folder with the Hidden check box ticked.

No Confirm Attribute Changes window appears. The folder is hidden straight away, just like a file.

File list without the empty folder and no Confirm Attribute Changes window.

To unhide it, show hidden items, untick Hidden, and click Apply. Again, no prompt appears.

Empty folder at normal color and no Confirm Attribute Changes window.

Now, I’ll hide this folder again, but this time I’ll put a file inside it.

Confirm attribute changes prompt appears this time when hiding the folder.

The Confirm Attribute Changes window appears because the folder is no longer empty. I’m going to stop the practical here because the purpose is to show how the Hidden attribute behaves differently with empty and non-empty folders.

However, there’s another interesting scenario. When you select two empty folders and try to apply the Hidden attribute, the Confirm Attribute Changes window still appears, even though neither folder contains any items.

Two empty folders selected and showing a confirm attribute changes window.

I don’t know the reason for this behaviour, but I tested it several times and got the same result each time.

Observation: The behaviours demonstrated in this part are based on my own testing. I couldn’t find any official documentation confirming them, so I’m presenting them as observations rather than established facts.

Hiding and unhiding multiple items at once

Windows also allows you to apply the Hidden Attribute to multiple files and folders simultaneously.

For this practical I’m using a fresh setup. Drive E holds three files and two folders, none of them hidden, and the Hide/Show setting is set to not show hidden items. I’ll select everything and open Properties.

Properties window showing 3 files and 2 folders with the Hidden check box unticked

Tick Hidden and click Apply. Confirm Attribute Changes appears again.

Confirm Attribute Changes window with options for the selected items.

The window appears because the selection includes folders. It appears even when they’re empty, as we saw earlier. If we had selected only the three files, it wouldn’t appear.

The wording has changed too. For a single folder it said “this folder.” Now it refers to the selected items:

  • Apply changes to the selected items only
  • Apply changes to the selected items, subfolders and files

I’ll choose the second option, click OK, and click OK on Properties. All the selected items are now hidden.

Drive E file list showing no items

To unhide them, show hidden items, select everything, untick Hidden, click Apply, and choose the second option in the window that appears.

Drive E showing all files and folders at normal color

When some selected items are already hidden: Now a mixed selection. I’ll use three files only (we’ve already seen folders). A RAR file, an Excel file, and a Notepad file are in drive E, and I’ve hidden only the RAR file. Hidden items are shown, so it appears faded while the other two look normal.

Showing hidden items matters here. With the setting off, the RAR file wouldn’t be visible or part of the selection.

A faded RAR file next to a normal Excel and Notepad file.

Select all three files and open Properties.

Properties window of 3 files with a dash in the Hidden check box.

The tab shows 3 Files, 0 Folders, and the Hidden box shows a dash (–), not an empty box. The dash is a mixed state: some of the selected items are hidden and some aren’t. You now have three choices:

  • Leave it as a dash: nothing changes, and only the RAR file stays hidden.
  • Tick it: all three files become hidden.
  • Untick it: all three files become unhidden.

If you tick or untick the box and click Apply, the dash disappears, and there’s no way to bring it back. Reopening Properties shows either a tick or an empty box. I’ll tick the box, click Apply, and then click OK.

File list with the RAR, Excel and Notepad files all showing faded icons

All three files are now hidden. No Confirm Attribute Changes window appeared, because the selection contained only files.

The point to remember is that with multiple selection, the attribute applies to the whole selection, not item by item. There’s one more multi-selection scenario, but it needs the System attribute, so it comes later in the lesson.

Items added later aren’t hidden

Earlier, when we hid a folder with its subfolders and files, I said there was one thing about that option that’s easy to get wrong. This is it.

There’s a common misconception about hiding a folder with Apply changes to this folder, subfolders and files: that anything you add to the folder afterward will be hidden automatically. I believed this myself until I tested it. Let’s see what actually happens.

I’ve set up a fresh Testing Folder 1 with one subfolder and one file inside, and hidden items are shown. I’ll hide the folder using Apply changes to this folder, subfolders and files.

Confirm Attribute Changes window with the second option selected for Testing Folder 1.

The folder and the items inside it are now faded. Next I’ll add one more subfolder and one more file to it. Most people expect both new items to be hidden as well.

Testing Folder 1 opened, with the old items faded and the two new items in normal color

Both new items look completely normal. The icons are the first sign, and Properties confirms it. The original subfolder has Hidden ticked, while the new subfolder doesn’t.

Two Properties windows, one with the Hidden check box ticked and one with it unticked.

So the hidden attribute isn’t dynamic. Applying it to a folder’s subfolders and files is a one-time action, and it affects only the items that exist at that moment. Anything added later starts without the attribute.

Observation: during testing I observed this behavior, but did not find any official documentation, so it is marked as an observation rather than a confirmed fact.


2.4 Hidden Attribute on a Phone

So far, we’ve seen how the Hidden attribute is attached to files and folders and how we can view or change it through the Properties window. However, there’s one more important point to understand: the availability of file attributes can also depend on how Windows accesses the storage device and what its underlying file system supports.

To see this, I’ve connected my smartphone to the PC with a USB cable, with the USB mode set to file transfer. I created a new folder on the phone called Testing Folder. Let’s open its Properties and see what the General tab shows.

Properties window of a phone folder with the Hidden check box greyed out and unticked.

The Hidden box is there, but it’s greyed out and unticked, so we can’t change it. The reason is how a phone connects to Windows.A USB flash drive uses USB mass storage: Windows reads the drive’s file system directly and gives it a drive letter.

A phone normally uses MTP (Media Transfer Protocol), which works at the file level. The phone keeps control of its own storage, Windows only asks it to list, copy, or delete files, and the phone appears as a device with no drive letter.

This PC listing the phone as a device without a drive letter

Since Windows isn’t managing that file system, the most likely reason the Hidden box is unavailable is that changing this attribute isn’t something the phone offers.

Now let’s move the same folder to drive E. I’ll cut it from the phone and paste it into drive E, then open its Properties again.

Properties window of the folder on drive E with the Hidden check box enabled.

The box is now enabled and can be ticked or unticked. It’s the same folder, but it now lives on a drive Windows manages, so the attribute is available.

Observation: This behaviour is also marked as an observation because I couldn’t find any official Microsoft documentation explaining the behaviour demonstrated in this section.

Now that we’ve seen how to hide and unhide items, and where the attribute isn’t available, let’s see in the next part, how hidden items actually behave when we use them.


Part 3: How Hidden Items Behave in Windows

Now that we can hide and unhide items, let’s see how they behave. This part tests what changes on screen, what happens when you copy, move or delete hidden items, and how they show up in search, recent lists and pinned places, and when you open them directly.

3.1 What Changes and What Doesn’t

In this subsection we’ll test everyday actions, like viewing, selecting, copying and deleting, to see what the Hidden attribute affects and what it doesn’t.

The Desktop

It’s easy to assume that items on the Desktop are exempt from the setting. They aren’t. The Desktop is just a folder in your user profile, and the attribute works there the same way. I’ve created an empty folder called Testing Desktop and hidden it, with the Hide/Show setting set to not show hidden items. Because the folder is empty, no extra prompt appears, and it disappears immediately.

Desktop with the Testing Desktop folder no longer visible.

Now I’ll turn on hidden items.

Desktop showing the Testing Desktop folder with a faded icon

The folder appears faded, exactly as elsewhere. The Desktop is no special case. There are a few places, though, where a hidden item still shows up, and we’ll meet them later in this part.

Folder Properties

Does a folder’s Properties window show a different item count or size when its contents are hidden? I’ll compare before and after hiding all the items inside a folder.

Two folder Properties windows with identical item counts and sizes and an unticked Hidden check box

The counts and size are identical, whether or not hidden items are shown. Visibility doesn’t change how Windows calculates them.

Properties does count everything, though. If it reports more items than you can see, something inside is hidden.

One more thing worth noticing: even though all items inside the folder are hidden, the Hidden checkbox on the main folder itself remains unchecked. This happens because we applied the Hidden attribute only to the contents, not to the folder. As a result, looking only at the main folder’s Properties can give a false impression that nothing is hidden inside.

Thumbnails

Here’s an interesting one. A folder that contains only a PDF, viewed with large icons and thumbnails enabled, shows a small preview of the PDF on its icon.

Folder in Large icons view with a small PDF preview on the folder icon

I’ll hide the PDF, with the setting off. Does the preview still show?

Folder icon still showing a PDF preview after the file was hidden.

It does. The file is hidden, but the folder icon still shows it. I repeated this with another folder and an Excel file, with the same result.

Folder icon still showing an Excel preview after the file was hidden.

Folder icon still showing an Excel preview after the file was hidden.

Observation: I repeated this several times, including restarting File Explorer and the PC, and the result was the same. Windows keeps a thumbnail cache, and I didn’t test clearing it, so I didn’t find any official documentation and have marked this as an observation rather than a confirmed fact. If you try it and see a different result, I’d like to hear about it.

Select All

The status bar shows the number of items and the number selected. My test folder has one folder and three files. With Select All, it shows 4 items, 4 selected.

File Explorer status bar showing 4 items and 4 items selected.

Now I’ll hide two of the files, with the setting off, and select all again.

Status bar showing 2 items and 2 items selecte.

Only 2 items appear, and 2 selected. The hidden files are not counted in either number. Now I’ll turn on hidden items and select all again.

Status bar showing 4 items and 4 items selected with two faded icons.

The hidden files appear faded, and the status bar counts them again. Unlike Properties, which counts everything, the status bar counts only what Explorer is currently showing.

Copy and Move

What happens when you copy or move hidden items? On drive E, Testing Folder 1 and all its contents are hidden, and hidden items are shown.

Testing Folder 1 and its inner items shown with faded icons.

I’ll copy the folder into Testing Folder 2 on the same drive.

Copied Testing Folder 1 inside Testing Folder 2 with faded icons.

The attribute went with the folder, and the copy and everything in it is hidden too.

Now a second case. I deleted both folders and created Testing Folder 3 with some items. This time I hid only the items inside, not the folder, and turned hidden items off.

Testing Folder 3 appearing empty because its items are hidden.

Then I copied Testing Folder 3 into a new Testing Folder 4.

Copied Testing Folder 3 appearing empty.

The copy looks empty. Now I’ll turn hidden items on.

Copied folder showing faded items after turning on hidden items.

The items are there, faded. So copying a folder copies its hidden contents even when you can’t see them, and the attribute goes with them.

Moving works the same way. I moved Testing Folder 3 to drive F.

Testing Folder 3 on drive F with its contents shown as faded icons

Renaming, Replacing and Deleting

Renaming: A common assumption is that renaming a hidden item makes Windows treat it as new and reset the attribute. It doesn’t. Testing Folder 1 has the attribute applied, along with its contents, and hidden items are shown.

Testing Folder 1 with faded icons before renaming.

I’ll rename it to Testing Folder 2.

Renamed Testing Folder 2 with the same faded icons

Only the name changed. The attribute, and the hidden contents, stay as they were.

Replacing: Now turn hidden items off, so Testing Folder 2 disappears. Then right-click an empty area, choose New → Folder, name it Testing Folder 2, and press Enter.

Confirm Folder Replace window for a folder named Testing Folder 2.

Windows reports that the location already contains a folder with that name and offers to merge them. So hiding doesn’t move an item somewhere else. The folder isn’t visible, but it’s still in the same place, and its name is still taken.

Note: When copying or moving a folder into a location containing a hidden folder with the same name, Windows may silently merge their contents if Hide folder merge conflicts is enabled. Since the destination folder remains hidden, you might not notice that the operation succeeded. Enabling Show hidden items can reveal the merged contents.

Deleting: Turn hidden items back on, so Testing Folder 2 appears faded. If I delete it and restore it from the Recycle Bin, is the attribute still applied, and what happens to the contents?

Faded Testing Folder 2 before deletion.

Before restoring, I’ll open its Properties in the Recycle Bin.

Properties window of the deleted folder with greyed-out attributes and the Hidden box ticked.

The attribute options are shown but greyed out, so you can’t change them here. The Hidden box is ticked, which shows the folder was hidden when it was deleted.

Notice also that the folder appears in the Recycle Bin as a normal item, with an icon that isn’t faded, whether hidden items are shown or not.

Now I’ll restore it with the Restore button below the attributes.

Restored folder and its contents shown with faded icons.

The folder returns with the attribute on both the folder and its contents, exactly as before. So the attribute stays with an item through copying, moving, renaming, and even deleting and restoring.

So far we’ve worked with one folder and one drive. Next we’ll look at a whole drive, where hidden items can account for a lot of used space while nothing appears to be there.


3.2 Setting vs Attribute

In this subsection we’ll separate the setting from the attribute: what a drive shows, how hidden items behave on a pen drive and on another computer, how the setting differs between users, and what happens when a hidden item is archived or has a shortcut.

Drives

In 3.1 we saw that a folder’s Properties show accurate counts and size even when its contents are hidden. Now let’s see what a drive’s Properties show. On drive E I have some folders and files. I’ve hidden them all, and the Hide/Show setting is set to not show hidden items.

Two Properties windows of drive E with the same used space.

The used space is the same before and after. Drive E now looks empty, but its Properties report data on it. This is the pen-drive puzzle from the Introduction, and we’ll work through it later in this lesson. A drive always shows a small amount of used space for the file system’s own data, so what matters is a figure that doesn’t match what you can see.

Notice also that the drive’s Properties window has no Hidden box, so you can’t hide a drive the way you hide a folder.

Pen drive

Does the setting affect a pen drive too? I created a folder on the pen drive and hid it, with hidden items shown.

A faded folder on the pen drive and a Properties window showing the FAT32 file system.

The pen drive behaves like any other drive: the folder appears faded. The pen drive’s file system is FAT32, while drive E is NTFS, so the attribute works on both.

Now let’s move the hidden folder from the pen drive to Drive E.

Hidden folder preserving its Hidden Attribute after being moved.

The Hidden Attribute remains intact after the move

For a reverse test, I moved a hidden folder named Testing Folder from Drive E back to the pen drive.

Hidden folder appearing with its Hidden Attribute preserved.

Again, the Hidden Attribute remains attached to the folder and its contents.

The pen drive now holds a hidden folder with a hidden subfolder. Now let’s see what happens when the same pen drive is opened on another Windows installation.

Because I did not have access to a second physical computer, I used a Windows 10 virtual machine for this test. That also shows whether the attribute works the same on another Windows version. Because it’s a virtual machine, I’m marking the results as observations.

Windows 10 virtual machine showing an empty pen drive.

The pen drive looks empty, because the VM’s setting is the default: don’t show hidden items. Having hidden items on a drive doesn’t make them show on another computer. Whether they appear depends on that computer’s setting. Now I’ll turn on hidden items.

Windows 10 showing the hidden folder and subfolder with faded icon.

The folder and its subfolder appear faded, so the pen drive behaved just like any other drive.

Observation: This practical was performed using a Windows 10 virtual machine rather than a separate physical computer. The results are therefore recorded as a testing observation.

Different user accounts

A PC can have several user accounts, and by default each shows the setting as “Don’t show hidden items.” If one user turns it on, does it affect the others? I created User A and User B. Both start with the default.

User A

File Explorer Options in User A set to not show hidden items.

User B

File Explorer Options in User B set to not show hidden items.

Next, I changed User A’s setting to Show hidden items.

File Explorer setting showing hidden items enabled.

Then I switched back to User B.

User B still configured to hide hidden items.

User B’s setting remained unchanged.

This confirms that the Show/Hide Hidden Items setting is stored per user account. Changes made by one user affect only that user and do not automatically affect other accounts on the same computer.

Archives: Windows ZIP vs WinRAR

What happens to the attribute when a hidden item is archived? I tested two tools, so these results may not apply to others.

Windows ZIP: I have a hidden folder called Test Folder, with hidden items shown. I’ll right-click it and choose Compress to ZIP file.

Context menu of the hidden Test Folder with Compress to ZIP file highlighted.

The ZIP file appears next to the folder, with a normal icon, not faded. Comparing the Properties of the two:

Two Properties windows, the folder with Hidden ticked and the ZIP file with it unticked

The ZIP file itself isn’t hidden. Next I’ll extract it. I’ll move the ZIP to the pen drive first, because extracting next to the original would recreate the folder merge from 3.1.

Extract All dialog on the pen drive.

The extracted Test Folder has a normal icon. Checking its Properties confirmed that the Hidden Attribute was no longer applied.

Extracted folder with Hidden checkbox cleared.

In this test, the ZIP process didn’t preserve the original folder’s Hidden attribute through extraction.

WinRAR: Now the same test with WinRAR. I have a hidden folder, Test RAR, in drive E. I’ll right-click it and use WinRAR’s option to add it to a RAR archive.

Context menu of the hidden Test RAR folder with WinRAR's option highlighted.

The RAR file appears next to the folder. As with the ZIP, the folder is hidden, but the RAR file isn’t.

Two Properties windows, the folder with Hidden ticked and the RAR file with it unticked.

I moved the RAR to the pen drive, which I had cleaned beforehand, and extracted it there.

Faded Test RAR folder and its Properties window with Hidden ticked.

This time the result is different: the extracted folder is faded and its Hidden box is ticked. With WinRAR, the attribute came back after extraction.

Observation: I tested only Windows’ built-in ZIP and WinRAR’s RAR. I found conflicting user reports online and no official documentation, so this is marked as an observation rather than a confirmed fact. Other tools may behave differently.

Shortcuts

Shortcuts behave differently from the files and folders they point to. Since a shortcut is a separate item, it has its own attributes, independent of its target.

In drive E, Testing Folder 1 and its contents are hidden, and hidden items are shown. I’ll create a shortcut to it on the Desktop: right-click the Desktop, choose New → Shortcut, and browse to the folder.

Faded Testing Folder 1 and the New Shortcut menu on the Desktop.

The shortcut’s icon isn’t faded, and its Hidden box is unticked.

Shortcut with a normal icon and an unticked Hidden check box.

Opening it takes you to the original folder in drive E, where the items inside are still faded.

Drive E window showing Testing Folder 1 with faded items opened from the shortcut.

Now I’ll tick Hidden on the shortcut itself and click Apply. No extra prompt appears, and the shortcut’s icon turns faded.

Shortcut with a faded icon and the Hidden check box ticked.

I unticked it again and the icon returned to normal. Hiding or unhiding the shortcut had no effect on the original folder or the items inside it. In my testing, the shortcut’s attribute is separate from its target’s.

We’ve seen where the attribute goes and who sees it. Next, how a hidden item behaves when you search for it.


3.3 Hidden Items in Search and Recent Lists

Browsing isn’t the only way to find a file. In this subsection we’ll see whether File Explorer search, a third-party search tool, and File Explorer’s Recent list respect the Hidden attribute.

Windows Search

Let’s start with a fresh setup. I have a folder called Testing Folder 1 in drive E with some items inside, and no Hidden attribute applied. I’ll search for it in File Explorer. Where you search matters, so I’m searching in drive E.

Search results listing Testing Folder 1 with the Open folder location option and the resulting drive E window.

The folder appears. Right-clicking it and choosing Open folder location opens it in drive E.

Search result opening the original location of the folder.

Note: Windows also provides Start Menu Search. However, Start Menu Search primarily relies on Windows Search indexing. By default, Windows indexes common user locations such as Desktop, Documents, Downloads, Pictures, Music, and Videos. Since my test folder is stored in Drive E rather than an indexed location, it does not appear through Start Menu Search. For this practical, we’re focusing specifically on File Explorer Search behavior. See Microsoft’s page on search indexing.

Now I’ll hide Testing Folder 1 and search again, with the setting set to not show hidden items.

Search window showing no results.

The result is blank. I can change the setting right in the search window, either from the View menu or the three-dot (…) menu. I’ll use the three-dot menu.

Search results showing Testing Folder 1 with a faded icon.

The folder appears immediately, without searching again, with a faded icon. So the setting affects search just as it affects browsing.

Now a second test. I hid Testing Folder 1 but not its contents. Inside is a subfolder called One Movie.

Testing Folder 1 hidden while the One Movie subfolder remains visible.

With hidden items off, I searched for One Movie.

Search results listing the One Movie folder.

It appears, even though its parent is hidden. I also tried the reverse: One Movie hidden and its parent not, with the setting off. Searching for One Movie found nothing. Search follows each item’s own attribute, not its parent’s.

Third-party search: Everything

Let’s see how a third-party search tool treats hidden items. I use an application called Everything. I’m not changing any of its settings, so these results reflect its default configuration, and other tools may behave differently. Testing Folder 1 and its contents are no longer hidden, and hidden items are off. First I’ll search for the folder.

Everything listing Testing Folder 1 with the letter D in the Attributes column.

The folder appears with its name, path, and an Attributes column showing D. In Everything, D stands for Directory, which just means the item is a folder.

Now I’ll hide the folder and its contents, leaving the setting as it is, and search again.

Everything listing Testing Folder 1 with a normal icon and HD in the Attributes column.

Everything still lists the folder, with a normal icon, not faded. The attributes now read HD: H for Hidden and D for Directory. That’s different from File Explorer search, which didn’t show this folder.

Now I’ll right-click the result and choose Open path.

Everything's Open path option and drive E opened without the folder.

Drive E opens, but the folder isn’t there, because Explorer’s setting still hides it. So Everything can list a hidden item, but the folder only appears in Explorer once the setting is on. I’ll turn it on and try again.

Everything's result unchanged and drive E showing the faded folder.

The Everything result is unchanged, with HD, and this time Open path shows the folder in drive E with a faded icon.

File Explorer Recent items

The Home page of File Explorer shows a list of recent items. Other places keep recent lists too, and the principle is the same, but we’ll focus on the Home page. To learn more about this list and its privacy settings, see our File Explorer Options lesson. Make sure Show recently used files is on.

I’ll start with a PDF called Hitman Manual in drive E. I opened it two or three times so it appears in the Recent list. At this point, it isn’t hidden.

File Explorer Home with Hitman Manual listed in Recent.

Now I’ll hide the PDF, with hidden items set to not show, and refresh Home.

Drive E without the PDF and the Recent list still listing it with a normal icon.

The file is hidden, but it’s still in the Recent list, with a normal icon. Next, I’ll right-click the entry and choose Open file location.

Drive E without the PDF and a Properties window with the Hidden check box ticked.

Drive E opens, but the file isn’t there, because it’s hidden. The entry’s Properties show Hidden ticked, so the file does have the attribute.

Properties showing the Hidden checkbox selected.

So although the Recent list can still reference the file, the file itself remains hidden in its original location.

Next, let’s open the file directly from Recent Items.

Hidden PDF file opened from Recent Items.

The PDF opens successfully. So a hidden file can still be opened from the Recent list.

Now I’ll turn on hidden items. The list doesn’t change, and the file appears in drive E with a faded icon. Here’s an experiment. The first time the PDF entered the list, it wasn’t hidden. The list updates when you reopen a file, moving it to the top and changing its access time. So I’ll open the now-hidden PDF from drive E and see what changes.

Drive E with the faded PDF icon and the PDF open.

After doing so, the Recent list updated the access time and moved the file toward the top of the list.

Recent list with the PDF at the top and a new access time.

The PDF moves to the top, with a new access time. Now I’ll set the setting back to not show hidden items.

Recent list with the PDF missing

This was a surprise: the PDF disappears from the list. I’ll turn hidden items back on.

Recent list with the PDF listed again at the top

It returns, at the same spot.

Observation: During testing, I consistently observed that recently opened hidden files behaved differently depending on when the Hidden Attribute was applied and whether the file was later reopened while hidden. I was able to reproduce this behavior multiple times, but I could not find official Microsoft documentation explaining the underlying mechanism. Therefore, this behavior is being recorded as a testing observation rather than a confirmed Windows design rule.

Additional Observation: Pinned and Favorite Items

During testing, I observed similar behavior with pinned folders and favorite files.

Items that were added before receiving the Hidden Attribute often behaved differently from items that were added after the Hidden Attribute had already been applied. In many cases, their visibility appeared to follow a pattern similar to the Recent Items behavior demonstrated above.

Because the overall behavior closely mirrored the Recent Items results, I chose not to repeat the full practical here. However, it is worth remembering that locations such as Quick Access, Favorites, and other pinned lists do not always behave exactly like normal folder views when hidden items are involved.

In the next section, we’ll investigate several ways to directly access hidden items, even when they are not visible in File Explorer.


3.4 Accessing Hidden Items

Hiding an item removes it from the normal view, but it doesn’t block access. In this subsection we’ll look at three ways to reach hidden items: typing a path, using lists from Windows and apps, and the command line.

Using a path

You can open a hidden item by typing its full path into File Explorer’s address bar. I have Testing Folder 1 in drive E, containing a subfolder called One Movie and a PDF called Hitman Manual. First I hid only the folder, not its contents, and set hidden items to not show.

Drive E file list without Testing Folder 1.

Since hidden items are not being displayed, Testing Folder 1 no longer appears in Drive E. However, if we enter the full path directly into File Explorer’s address bar, we can still access the folder.

As I start typing E:\Testing Folder 1, Explorer suggests the folder name. I select it and press Enter.

Address bar showing E:\Testing Folder 1 with the folder's items listed.

The folder opens, and since its contents aren’t hidden, I can reach every item. The Run box works too: press Win + R, paste E:\Testing Folder 1, and press Enter.

Run dialog with E:\Testing Folder 1 typed and the folder open behind it.

Now I’ll hide the contents too. Opening the folder by path shows it empty.

Testing Folder 1 opened by path with no items shown.

So, can we access the PDF file directly by entering its full path? Let’s try.

I enter E:\Testing Folder 1\Hitman Manual  and the PDF opens.

Run dialog with the path to Hitman Manual.pdf and the PDF opened.

The PDF opens successfully. I also tested the same file through the Run dialog. Here, I found one small difference: entering the path without the file extension produced an error. Adding .pdf to the filename allowed Run to open it successfully.

So, for this example, the complete path in Run is: E:\Testing Folder 1\Hitman Manual.pdf

Tip: Windows hides extensions of known file types by default, so you may not see “.pdf” in Explorer. To type a full file path, you can turn extensions on, as shown in our file extensions lesson.

So even when a folder and its files are hidden, their full paths still work.

Jump Lists and Application Recent Lists

If an app is pinned to the taskbar, right-clicking its icon shows a jump list with recent items. File Explorer is pinned on my taskbar, and its jump list shows both pinned and recent folders, including Testing Folder 1.

Jump list of File Explorer with Testing Folder 1 listed.

I won’t go deep here. In my testing, choosing Testing Folder 1 from this list opens the folder, and whether its contents appear depends on the Hide/Show setting. The entry looks the same whether or not the folder is hidden. I also hid the folder after it appeared in the list, and unlike the Recent list in 3.3, the entry wasn’t affected.

Now an application example. I pinned VLC to the taskbar and played two MP3 files from drive E, Song 1 and Song 2. They appear in VLC’s jump list.

Drive E with two MP3 files and VLC's jump list listing both.

I then hid both files, with hidden items off, and chose Song 1 from the jump list.

Drive E without the MP3 files and a VLC message saying the media is unavailable.

VLC says the media isn’t available, suggesting it might have been removed, renamed, or deleted. But the jump list isn’t VLC’s only recent list. The taskbar jump list is managed by Windows, and VLC keeps its own list too. In VLC, I opened Media → Open Recent Media, where both songs are listed, and played Song 1.

VLC's recent media list and Song 1 playing.

It played without any error, even though the file is hidden. I tested another media player, KMPlayer, and a PDF in Adobe Reader, and both behaved the same way when opened from their own recent lists. However, this shouldn’t be treated as a universal rule for every application; the result can depend on how each application handles its recent entries.

One more test is worth mentioning. I’ll now change File Explorer’s setting to Show hidden items and try to open Song 1 again through VLC’s taskbar Jump List.

Drive E with faded MP3 files and VLC playing Song 1.

This time, VLC successfully opens the file through the Jump List.

In my testing, the Jump List’s ability to open the file was affected by whether hidden items were currently being displayed. The application’s own recent-media list, however, could still open the file when File Explorer was set to hide hidden items.

Using Command Prompt

Now the command line. Drive E holds Testing Folder 1 and the two songs, and nothing is hidden. I’ll open Command Prompt from Run, switch to drive E, and run dir.

Command Prompt listing Testing Folder 1, Song 1 and Song 2

It lists all three. Now I’ll hide everything, with hidden items set to not show, and run dir again.

Command Prompt output reading File Not Found.

It reports File Not Found. That isn’t Explorer’s setting at work, though. It’s how dir behaves: Microsoft’s documentation says that without /a it lists all files except hidden and system files, and /a with no attributes lists everything. I’ll try dir /a.

Command Prompt listing Testing Folder 1, the songs, $RECYCLE.BIN and System Volume Information.

Now all three items appear, and two more folders as well: $RECYCLE.BIN and System Volume Information. These are hidden system items, and we’ll look at them later in this lesson.

Note: PowerShell also provides commands for viewing hidden items, but since our next section focuses on the ATTRIB command, we’ll leave PowerShell out of this lesson to avoid covering multiple command-line tools at once.

dir /a only reads attributes. There’s another command that can read and change them, and that’s attrib, which we’ll look at next.


Part 4: The attrib Command

So far we’ve hidden items with Windows’ graphical settings. attrib is a command-line tool that does the same job and also offers options the graphical settings don’t. It has many options, and we’ll cover only those that matter for this lesson: mainly the Hidden attribute, with a brief look at the System attribute.

4.1 What ATTRIB Is and How to Run It

The attrib command is a built-in Windows command-line utility used to display or change attributes assigned to files and folders. It has been available across many generations of Windows, including Windows XP.

Unlike the graphical interface, attrib provides additional command-line options for managing attributes. It can show the attributes of every item in a folder or on a drive at once.

Opening ATTRIB

Windows provides two command-line environments: Command Prompt and PowerShell. The attrib command can be used in both, so you can choose whichever environment you prefer. For the demonstrations in this lesson, I’ll use Command Prompt (CMD).

To open it, press Win + R, type cmd, and press Enter.

Command Prompt window opened from Run.

By default, Command Prompt usually starts in your user profile folder.

Tip: Typing cmd in File Explorer’s address bar and pressing Enter opens Command Prompt already inside that folder.

If you’re not familiar with Command Prompt navigation, don’t worry. We only need a few basic commands for this lesson.

Here are the three commands I’ll use:

CommandPurpose
E:Switches to drive E:.
cd ..Moves up one level to the parent directory.
cd "Folder Name"Enters the specified folder within the current directory.
Examples of navigating drives and folders using Command Prompt.

You can also use cd \ to move directly to the root directory of the current drive.

Running the ATTRIB Command

Now, let’s run attrib from the root directory of the C: drive.

ATTRIB output showing attribute letters such as A, H, and S.

At first glance, the output may look confusing. Notice how some entries begin with letters such as: A, H, SH, I.

These letters represent file attributes assigned to individual files and folders. For now, simply focus on observing them. In the next subsection, we’ll learn what these attribute letters mean and how they relate to hidden and system files.


4.2 Reading the Output

When you run the attrib command, Windows displays the attributes assigned to each file or folder using letters. Each letter represents a particular attribute.

Here are the ones that matter for this lesson.

LetterAttributeMeaning
HHiddenMarks a file or folder as hidden.
SSystemIdentifies a file or folder as a system item.
RRead-onlyMarks a file or folder as read-only.
AArchiveIndicates that a file has been modified since it was last backed up.
INot Content IndexedIndicates that the file or folder is excluded from content indexing.

Let’s briefly understand what each letter represents.

  • H (Hidden). The item is left out of normal listings, which is the attribute this whole lesson is about. attrib adds it with +h and removes it with -h, as we’ll see in 4.3.
  • S (System). A second attribute, used for files and folders Windows itself relies on. Windows hides these by default, and the next part covers how. H and S often appear together as SH. For now, just recognize the letter.
  • R (Read-only). The file can be opened but not saved over. It’s the other box on the General tab.
  • A (Archive). Windows sets this automatically whenever a file is created or changed, to mark it as “changed since the last backup.” Backup tools use it. It has nothing to do with visibility, which is why it appears on so many ordinary files.
  • I (Not content indexed). Tells Windows Search not to index the item’s contents. You’ll see it on many Windows folders.

attrib supports a few other attributes, mostly for specialized features, and we won’t need them. The letters appear in fixed columns in front of each path, and a blank means the attribute isn’t set.

attrib And the Graphical Settings

Now let’s see how attrib behaves when we hide things with the graphical settings. In drive E I have a folder, Testing Folder 1, and two files, Song 1 and Song 2. Nothing is hidden yet. I opened Command Prompt directly in drive E by typing cmd in File Explorer’s address bar and pressing Enter, so there’s no need to change directory. Now I’ll run attrib.

Drive E with Testing Folder 1, Song 1 and Song 2, and Command Prompt listing the two songs.

It lists only the two files:

A                    E:\Song 1.mp3
A                    E:\Song 2.mp3

Both have the letter A (Archive), which we covered in the table. Testing Folder 1 is visible in drive E but missing from the output, because plain attrib lists files only. To include folders, you add /d. But first, a quick practical.

I’ll hide both songs with the Hidden box in Properties, with the Hide/Show setting set to not show hidden items, so they disappear from drive E. Then I’ll run attrib again.

Drive E without the songs and Command Prompt listing them with the letters A and H.

The songs are gone from Explorer, but attrib still lists them, and each now has an H:

A   H                E:\Song 1.mp3
A   H                E:\Song 2.mp3

The new H is the Hidden attribute we just applied. Unlike Explorer, attrib doesn’t depend on the Hide/Show setting. It reads the attributes directly, so it lists hidden files either way.

Now I’ll run attrib /d.

Command Prompt listing five items and drive E showing three faded items.

The output may look confusing at first:

   SH                E:\$RECYCLE.BIN
A   H                E:\Song 1.mp3
A   H                E:\Song 2.mp3
   SH                E:\System Volume Information
                     E:\Testing Folder 1

Take it step by step:

  • Song 1 and Song 2 have A and H, as before.
  • Testing Folder 1 appears now because of /d, and it has no letters at all. An item can have no attributes set, which is normal for a folder.
  • $RECYCLE.BIN and System Volume Information are the two items we saw in 3.4. Both show S and H: System and Hidden.

I also turned on hidden items after running the command. Drive E now shows Testing Folder 1 and both songs with faded icons, but the two system folders still don’t appear, even with hidden items on. That looks a lot like the pen-drive case from the Introduction, and the next part explains it.

For now, remember three things: plain attrib lists files, attrib /d lists folders too, and each item shows a letter for every attribute set on it, or none at all.

So far, we’ve changed the graphical settings and watched attrib react. Now let’s reverse it: change the attributes with attrib and see what File Explorer shows.


4.3 Changing Attributes

So far we’ve only read attributes. Now we’ll change them. In attrib, a plus (+) sign sets an attribute, while a minus (-) sign clears it. The letter following the sign specifies which attribute to change.

In the table, name stands for a file or folder name.

CommandPurpose
attrib +h filenameAdds the Hidden attribute
attrib -h filenameRemoves the Hidden attribute
attrib +s filenameAdds the System attribute
attrib -s filenameRemoves the System attribute
attrib +h +s filenameAdds both Hidden and System attributes
attrib -h -s filenameRemoves both Hidden and System attributes

Hiding a file

I’ve reset the items in drive E. Testing Folder 1, Song 1 and Song 2 have no hidden attribute, and all appear normal. I ran attrib /d again to confirm that nothing is hidden.

Drive E with Testing Folder 1, Song 1 and Song 2 next to attrib output showing no H.

Now I’ll hide Song 1 with attrib, with the Hide/Show setting set to not show hidden items. To hide, we use +h:

attrib +h "Song 1.mp3"
Command Prompt after running attrib +h on Song 1.mp3 and drive E without Song 1.

Song 1 disappears from drive E. Before going further, here are a few things that help you avoid errors:

  • Quotes for spaces. Write attrib +h "Song 1.mp3". Without quotes, my build showed the error Parameter format not correct, because the name contains a space. A name without spaces, like Song, works with or without quotes.
  • The extension is required. attrib +h "Song 1" gives File not found – Error. You need the full name, .mp3 included. Windows hides known extensions by default, so run attrib to see the real names, or turn extensions on as shown in our file extensions lesson.
  • Full paths work. I’m in drive E, but attrib +h "E:\Song 1.mp3" works too. That’s handy when you’re in a different folder.
  • Case doesn’t matter. +h and +H work the same way, just as "song 1.mp3" and "Song 1.mp3" refer to the same file.

If a command fails, check three things: quotes, the extension, and whether you’re in the right folder.

Now I’ll turn on hidden items and run attrib again.

Drive E with a faded Song 1 and attrib output listing it with the letters A and H.

Song 1 appears faded, and attrib shows A H for it. To unhide it, the command is the same with -h:

attrib -h "E:\Song 1.mp3"
Command Prompt after running attrib -h and drive E with a normal Song 1 icon.

Song 1 returns to a normal icon. With Command Prompt and drive E side by side, I saw Explorer update the moment I pressed Enter, with no refresh needed.

Hiding a folder

Now a folder. Testing Folder 1 in drive E contains a subfolder, One Movie, and a PDF, Hitman Manual. I’ll hide it the same way, with hidden items set to not show:

attrib +h "Testing Folder 1"
Command Prompt after hiding Testing Folder 1 and drive E without the folder.

The folder disappears. Now I’ll turn on hidden items, open the folder, and run attrib /d in drive E. A folder only appears in the output with /d.

A faded Testing Folder 1, its normal-colored contents, and attrib output with H on the folder.

The folder icon is faded and attrib /d shows H for it, but the items inside look normal. To unhide it, use attrib -h "Testing Folder 1".

attrib can do more than this, such as hiding many items at once and using other attributes, but we’ll stay with what this lesson needs.

Along the way we’ve seen letters we haven’t explained: S and SH. They belong to the System attribute, which is closely tied to Hidden, and understanding it is what solves the pen-drive puzzle. That’s next.


Part 5: Protected Files and the System Attribute

Throughout this lesson, we’ve left a few loose ends: two folders ($RECYCLE>BIN & System Volume Information) that stayed hidden even with hidden items turned on, a second setting just below Hidden files and folders, a Hidden box that was greyed out, and the letter S in attrib‘s output.

This part ties them together, and it’s the last piece we need to solve the pen-drive puzzle. We’ll start with the items Windows treats as protected, then look at the System attribute behind them, and finish by comparing real system items with ones we make ourselves.

5.1 What Are Protected Operating System Files?

Before we explore the System attribute and how to manage it using ATTRIB, let’s first understand another important concept: protected operating system files.

To demonstrate this, I’m going to create a new volume, F:, using Disk Management.

Empty drive F in File Explorer with hidden items shown

Drive F shows nothing, as expected. Now I’ll run attrib in it, first on its own and then with /d.

Command Prompt output for attrib and attrib /d beside the empty drive F.

Plain attrib returns File not found, because it lists files and there aren’t any. attrib /d includes folders, and it shows one:

   SH                F:\System Volume Information

I didn’t create this folder. Windows created it automatically on the new drive, and Windows hid it. Two things stand out.

  • First, drive F looks empty even though hidden items are on, yet attrib says the folder is there.
  • Second, its letters are S and H: System and Hidden.

We’ll look at the System attribute properly later in this part. But for now, the main question is: Why can’t we see this folder in File Explorer even when hidden items are enabled?

Protected Operating System Files

Windows has certain files and folders that are important for its operation. Some of these are marked with both the System and Hidden attributes, and Windows treats them as protected operating system files in File Explorer.

You can see an example in our demonstration. I only created a new volume, F:, but the System Volume Information folder was already present when I checked it. Windows had created this folder on the volume, and File Explorer was keeping it hidden from the normal view.

Let’s see how we can display such files and folders.

Open File Explorer Options and go to the View tab. Just below the hidden-items setting, you’ll find another option:

Hide protected operating system files (Recommended)

Advanced settings with the Hide protected operating system files check box ticked.

This second setting is enabled by default. That’s why our System Volume Information folder remains hidden even though ordinary hidden items are being displayed.

To display protected operating system files, we also need to disable this setting.

When I uncheck the option, Windows displays a warning message.

Warning dialog shown when unticking Hide protected operating system files.

The warning explains that these files are labelled System and Hidden and are required to start and run Windows. It also cautions that deleting or editing them can make the computer inoperable.

For this demonstration, select Yes, then click Apply and OK.

File Explorer Options showing protected operating system files set to display while ordinary hidden items are also enabled.

Now let’s open F: again.

Drive F showing a faded System Volume Information folder and unchanged attrib output.

System Volume Information now appears as a faded folder. The attrib /d output is the same as before, still SH, because attrib doesn’t depend on either setting.

One more quick test. I’ll leave the protected setting off and set Hidden files and folders back to not show hidden items.

File Explorer Options with ordinary hidden items disabled and protected operating system files still set to display.

As soon as I apply this change, the F: drive appears empty again.

This demonstrates that both settings affect the visibility of our protected folder. To display it, ordinary hidden items must be enabled, and protected operating system files must also be allowed to appear.

Windows hides more than this one folder. In the next subsection, we’ll look at several real examples of files and folders that Windows hides and examine the reasons behind them.


5.2 What Windows Hides on Its Own?

In the previous subsection, we revealed the System Volume Information folder on drive F: by changing File Explorer’s visibility settings. Now let’s move to the Windows drive (C:) and see what other files and folders Windows keeps hidden by default.

First, let’s look at what File Explorer and the attrib command show on the C: drive without changing any settings.

Drive C with normal view and ATTRIB showing additional files and folders.

Before examining Drive C, notice something interesting. In the screenshot, I also ran: attrib /d  on Drive F. When I first created that drive, attrib /d showed only the System Volume Information folder. However, after I opened the Recycle Bin, Windows automatically created another folder named $RECYCLE.BIN, also marked with the SH attributes. This is a behaviour I observed during testing.

Now let’s return to C:.

Explorer shows four folders: Program Files, Program Files (x86), Users, and Windows. But attrib /d lists much more, and most entries carry SH:

   SH                C:\$Recycle.Bin
A   H                C:\.GamingRoot
     R               C:\Documents and Settings
A  SH                C:\DumpStack.log.tmp
A  SH   I            C:\hiberfil.sys
    HR  I            C:\MSOCache
A  SH                C:\pagefile.sys
     R               C:\Program Files
     R               C:\Program Files (x86)
    H   I            C:\ProgramData
   SH   I            C:\Recovery
A  SH                C:\swapfile.sys
   SH                C:\System Volume Information
     R               C:\Users
                     C:\Windows

Note: Your C: drive may show additional items depending on your Windows installation and configuration. For example, Documents and Settings is a shortcut here whose target no longer exists, so it comes from my own setup and isn’t a standard Windows item.

Now I’ll turn on hidden items. The protected setting is already off, so both settings allow everything.

Drive C listing hidden and system items with faded icons.

The items from the attrib listing now appear, faded. These are the items Windows keeps out of everyday view. They aren’t permanently out of reach, and a couple of settings bring them back.

System files vs the System attribute

A common question arises at this point: Aren’t there other system files and folders too? So what separates a Windows file from one with the System attribute?

For example, the Windows folder itself is clearly an important operating system folder, yet ATTRIB shows no special attributes on it.

To understand why, let’s examine a few examples. First, let’s inspect one of the files that has both S and H attributes. I’ll use swapfile.sys as an example. Right-click the file and select Properties.

Properties of swapfile.sys showing the System file type and a selected, disabled Hidden attribute checkbox.

There are three things to notice here:

  • The type reads System file (.sys). That label comes from the .sys extension. It describes the file type, not the attribute.
  • The Hidden box is ticked and greyed out. You can’t change it.
  • There’s no box for the System attribute. We can’t set it through the graphical interface. We’ll set it with attrib in the next subsection.

Now let’s inspect a folder with both attributes applied. For this example, I’ll use the Recovery folder.

Recovery folder Properties showing the Hidden attribute selected and greyed out.

The same thing happens here: the Hidden checkbox is selected and greyed out, and there is no option to manage the System attribute directly.

One other detail is different. Under Type, Windows identifies this item simply as a File folder. Unlike files with extensions such as .sys, folders do not have a special file type label that identifies them as system folders.

So How does it differ from a normal folder? To find out, compare it with another folder: ProgramData.

According to our earlier attrib output, this folder has only the Hidden attribute (H), not the System attribute (S). Right-click it and open Properties.

ProgramData folder Properties showing the Hidden attribute selected and available to change.

Now the difference is clear. Both Recovery and ProgramData are folders, and both have the Hidden attribute applied. However, the Hidden checkbox for ProgramData is available to change, whereas the checkbox for Recovery is greyed out.

The difference is the System attribute. ProgramData has only H, while Recovery has both S and H. This is why File Explorer treats them differently when the protected operating system files setting is enabled.

The same goes for .sys files. A file with the .sys extension does not necessarily have the System attribute. Many .sys files can be found in C:\Windows\System32\drivers. Let’s check one of them, Diskdump.sys, Right-click the file and open Properties.

Diskdump.sys Properties showing the System File (.sys) type and an unchecked Hidden attribute.

The type is again System file (.sys), but the Hidden box is unticked and available, and attrib shows only A letter.

A                    C:\Windows\System32\drivers\Diskdump.sys

So having a .sys extension, or belonging to Windows, doesn’t mean the System attribute is set. Windows puts that attribute, together with Hidden, on a limited set of items.

We’ve seen what the System attribute marks and that the graphical interface can’t set it. Next, let’s set it ourselves with attrib and see what it changes.


5.3 What Is the System Attribute?

In upper subsection, we saw that items carrying the System attribute have a greyed-out Hidden box, and that Properties offers no way to set the attribute. Now we’ll set it ourselves with attrib on a test file, first alone and then together with Hidden, to see what each combination does.

Applying and Removing System Atttribute (+s, -s)

I’m starting from the default state: hidden items off and the protected setting on. I created a text file called Testing in drive F. Here’s how drive F looks, the file’s Properties, and attrib /d.

Normal text file with no System or Hidden Attribute applied.

Drive F: shows only the text file. Its Properties identify it as a Text Document (.txt), and the Hidden checkbox is available to change. attrib /d shows:

   SH                F:\$RECYCLE.BIN
   SH                F:\System Volume Information
A                    F:\Testing.txt

Now let’s apply the System attribute to Testing.txt, the same way we applied Hidden:

attrib +s Testing.txt

I didn’t use quotes because the name has no spaces, but the full name with its extension is still required. Let’s check the result in File Explorer, Properties, and Command Prompt.

Testing.txt remains visible after applying the System attribute, with its Properties showing a greyed-out Hidden checkbox.

The result is interesting because it clarifies three things:

  • The file is still visible. The System attribute on its own doesn’t hide anything.
  • The type is still Text Document (.txt). That label comes from the extension, so adding the attribute doesn’t turn an ordinary file into a “system file.”
  • The Hidden box is greyed out. The System attribute locks it, even though the file isn’t hidden.

The ATTRIB output now shows:

   SH                F:\$RECYCLE.BIN
   SH                F:\System Volume Information
A  S                 F:\Testing.txt

The output now shows A S beside Testing.txt. The A attribute was already present, and the S attribute has been added.

Let’s remove the System attribute and see what changes:

attrib -s Testing.txt
Testing.txt Properties showing the Hidden checkbox available after removing the System attribute.

As soon as we remove the System attribute, the Hidden checkbox becomes available again. The file is still visible, and its ATTRIB output no longer contains S.

This confirms that the System attribute can affect the availability of the Hidden checkbox, even when the file itself is not hidden.

Applying and Removing Both (+s +h, -s -h)

Now that we’ve seen what happens when only the System attribute is applied, let’s combine it with the Hidden attribute.

I’ll use the same Testing.txt file. Run:

attrib +s +h Testing.txt

Both visibility settings remain in their default state:

  • Show hidden items = Disabled
  • Hide protected operating system files = Enabled

Let’s see what happens.

Drive F appearing empty after applying both Hidden and System attributes to Testing.txt.

The file disappears, and drive F is blank. attrib shows:

A  SH                F:\Testing.txt

At first glance, this may seem similar to an ordinary hidden file, but let’s continue testing.

First I’ll set Hidden files and folders to show hidden items.

File Explorer Options showing Show hidden files, folders, and drives enabled.

Even after enabling Show hidden items, Testing.txt is still missing from drive F:.

Now let’s change the second setting. Uncheck Hide protected operating system files.

Drive F showing Testing.txt, $RECYCLE.BIN, and System Volume Information with faded icons.

Now Testing.txt appears alongside $RECYCLE.BIN and System Volume Information, all with faded icons. Let’s inspect the Properties of Testing.txt once more.

Testing.txt Properties showing the Hidden checkbox selected and greyed out.

The Hidden checkbox is selected and greyed out. The file is now hidden, and File Explorer treats it as a protected operating system file because it carries both the Hidden and System attributes.

This demonstrates the relationship between the two visibility settings:

  • Show hidden files, folders, and drives allows ordinary hidden items to appear.
  • Hide protected operating system files (Recommended) keeps items with both Hidden and System attributes hidden.

That’s why enabling Show hidden items alone wasn’t enough to reveal Testing.txt.

Now let’s remove both attributes and return the file to its original state.

attrib -h -s Testing.txt
Testing.txt displayed normally after removing its Hidden and System attributes.

The file is visible again, and its Hidden checkbox is now unchecked and available to change. The ATTRIB output shows only the Archive (A) attribute.

One small point about the commands: in my tests, changing the order of the attribute switches produced the same result. For example, I also tested:

attrib -s -h Testing.txt

It worked just like attrib -h -s Testing.txt. The same was true when applying the attributes using +h +s instead of +s +h.

So, in the combinations demonstrated here, the order did not affect the result.

Applying Hidden Without the System Attribute (+h -s)

Let’s perform one final experiment. This time, I’ll first apply both System and Hidden attributes to Testing.txt again:

attrib +h +s Testing.txt

Now, instead of removing both attributes, I’ll run:

attrib +h -s Testing.txt

This command keeps the Hidden attribute applied while removing the System attribute.

Let’s see how File Explorer displays the file now.

Testing.txt appearing faded in File Explorer, with the Hidden checkbox selected but not greyed out.

Now the file appears with a faded icon because it still has the Hidden attribute. However, the Hidden checkbox is selected but no longer greyed out.

Therefore, a greyed-out Hidden checkbox can be a useful clue that the System attribute is applied. However, it should not be treated as a definitive way to identify an item’s attributes. When in doubt, use attrib to check the actual attribute letters.

However, an important question still remains:

If we can apply the System Attribute to an ordinary text file, does that make it the same as Windows’ own system files and folders? Let’s explore that in the final subsection.


5.4 Normal Items vs System Items

In 5.3 we gave our own file the System attribute. Now we’ll do the same with a folder and compare it with the folders Windows created, to see whether a system item we make behaves like a real one. We’ll start with folders and move on to files afterward

Making our own system folder

I created a folder called Testing Folder in drive F, with some items inside. Both settings are at their defaults:

  • Show hidden items: disabled
  • Hide protected operating system files: enabled

Here’s drive F, the folder’s Properties, and attrib /d.

Testing Folder visible on drive F with its Hidden checkbox unchecked and no attributes applied.

Drive F shows only Testing Folder, and its Hidden box is available and unticked. attrib /d shows:

   SH                F:\$RECYCLE.BIN
   SH                F:\System Volume Information
                     F:\Testing Folder
A   H                F:\Testing.txt

Testing.txt is the file from the last practical, with only Hidden applied, so it’s invisible with hidden items off. Testing Folder has no attributes. I’ll apply both attributes directly:

attrib +h +s "Testing Folder"

I used quotes because the name has a space.

Drive F appearing empty after applying Hidden and System attributes to Testing Folder.

Drive F is now empty, and attrib /d shows:

   SH                F:\$RECYCLE.BIN
   SH                F:\System Volume Information
   SH                F:\Testing Folder
A   H                F:\Testing.txt

Now I’ll turn on hidden items.

Testing.txt appears as a faded item while Testing Folder remains hidden on drive F.

Testing.txt appears faded, since it only has Hidden. The new folder doesn’t appear yet. Now I’ll turn off Hide protected operating system files.

Testing Folder, $RECYCLE.BIN, and System Volume Information displayed with faded icons in File Explorer.

All three folders appear faded, and Testing Folder’s Hidden box is greyed out, just like on a system file.

Comparing with the real system folders

Let’s compare Testing Folder’s Properties with $RECYCLE.BIN.

Testing Folder and $RECYCLE.BIN Properties showing their Hidden checkboxes selected and greyed out.

Both show Hidden ticked and greyed out. Now I’ll open all three folders.

File Explorer showing the contents of the Recycle Bin and Testing Folder, alongside an Access is denied message for System Volume Information.
  • $RECYCLE.BIN opens normally. It holds one subfolder, which is also hidden, with its Hidden box ticked and greyed out.
  • System Volume Information shows Location is not available and Access is denied.
  • Testing Folder opens, and the items inside it aren’t hidden. Their Hidden boxes are unticked and available.

The last difference may only reflect how the attributes were applied. The command I ran sets them on the folder itself, and there’s another form that reaches everything inside, which we’ll meet in Part 6. I can’t tell how Windows set the real ones.

Removing the attributes

Now the main test: can we remove both attributes from these folders? But first a warning:

Warning: Removing attributes from real system folders isn’t something to try on a PC you rely on. I did it in a virtual machine first, then on my own system, and I restored the attributes afterward. I strongly recommend doing this only in a virtual machine.

I’ll start with my own folder, using the same command with minus signs:

attrib -s -h "Testing Folder"
Testing Folder displayed normally after removing its Hidden and System attributes.

The folder returns to normal, and attrib /d shows:

   SH                F:\$RECYCLE.BIN
   SH                F:\System Volume Information
                     F:\Testing Folder
A   H                F:\Testing.txt

Now the real folders. I tried System Volume Information first, and I got Access denied. Then I ran:

attrib -s -h "$RECYCLE.BIN"

This time the command worked.

System and hidden attributes successfully removed from $RECYCLE.BIN and Testing Folder.

$RECYCLE.BIN and Testing Folder now look normal, but System Volume Information is still faded. attrib /d shows:

                     F:\$RECYCLE.BIN
   SH                F:\System Volume Information
                     F:\Testing Folder
A   H                F:\Testing.txt

$RECYCLE.BIN now has no attributes, like Testing Folder, while System Volume Information still carries both. Let’s repeat this on drive C:, where attrib /d shows:

   SH                C:\$Recycle.Bin
A   H                C:\.GamingRoot
     R               C:\Documents and Settings
A  SH                C:\DumpStack.log.tmp
A  SH   I            C:\hiberfil.sys
    HR  I            C:\MSOCache
A  SH                C:\pagefile.sys
     R               C:\Program Files
     R               C:\Program Files (x86)
    H   I            C:\ProgramData
   SH   I            C:\Recovery
A  SH                C:\swapfile.sys
   SH                C:\System Volume Information
     R               C:\Users
                     C:\Windows

Apart from $Recycle.Bin and System Volume Information, the only folder with SH is Recovery. I tried to remove both attributes from all three.

Command Prompt showing two access denied messages and one successful command

The result is the same: only $Recycle.Bin lost its attributes, while the other two returned Access denied. attrib /d now shows:

                     C:\$Recycle.Bin
A   H                C:\.GamingRoot
     R               C:\Documents and Settings
A  SH                C:\DumpStack.log.tmp
A  SH   I            C:\hiberfil.sys
    HR  I            C:\MSOCache
A  SH                C:\pagefile.sys
     R               C:\Program Files
     R               C:\Program Files (x86)
    H   I            C:\ProgramData
   SH   I            C:\Recovery
A  SH                C:\swapfile.sys
   SH                C:\System Volume Information
     R               C:\Users
                     C:\Windows

Trying to Remove Attributes from System Files

Next, let’s try removing the System and Hidden attributes from some existing Windows system files.

I tried removing both attributes from several files, including swapfile.sys, hiberfil.sys, and pagefile.sys, with a command like this:

attrib -s -h swapfile.sys

However, each attempt returned the same error: Unable to change attribute.

Attrib shows an error while trying to remove attributes from system files.

This is different from our earlier test in 5.3, which we successfully added and removed both attributes from the text file we created manually on drive F:.

What this tells us

Here is how each item responded when I tried to remove both attributes:

ItemRemoving S and H
Our own file and folderWorked
$RECYCLE.BIN (drives C: and F:)Worked
System Volume Information (drives C: and F:)Access denied
RecoveryAccess denied
swapfile.sys, hiberfil.sys, pagefile.sysUnable to change attribute
  • What matched. An item we gave S and H behaved like Windows’ own for visibility. It stayed hidden until both settings were changed, and its Hidden box was locked. That was true for the file in 5.3 and for the folder here.
  • What differed. What we could do with an item differed. Our own items and $RECYCLE.BIN opened, and both attributes came off. System Volume Information and Recovery refused with Access denied, and the three files gave a different message.
  • What it means. The attributes themselves didn’t block anything, since our items and $RECYCLE.BIN carry S and H and opened and changed freely. Whatever blocked the others is something else. Access denied on the folders points to permissions, and Windows manages those three files itself. My tests don’t show the exact cause, and I didn’t inspect the permissions, so I’m not drawing a conclusion about it.
  • “Protected” describes the hiding. In Hide protected operating system files, the word refers to what the setting hides. It doesn’t decide what you’re allowed to do with those items.
  • Anyone can set them. Anything that can change an item can set both attributes on it, as we did with one command. That’s how the contents of a whole drive can end up hidden behind both settings, which is the pen-drive case.

We now have the full picture of the attributes: Hidden, System, the two settings that gate them, and how attrib changes them one item at a time. One piece is still missing for the pen-drive case, a way to reach every item in a folder or on a drive with a single command. That’s where we start.


Part 6: Solving the Hidden Pen-Drive Problem

This is the case from the Introduction: a pen drive that looks empty even with hidden items on. We now have every piece: the Hidden and System attributes, the two settings that hide them, and attrib. In this part, we’ll learn to apply attrib to many items at once, recreate the problem on a test drive, and solve it. First, we need to understand how attrib works on many files and folders, so that one command can cover a whole pen drive.

6.1 Using attrib on Many Items at Once

In the previous parts, most of our ATTRIB commands targeted a single file or folder at a time. However, a hidden pen-drive problem usually affects many files and folders at once. To investigate and fix such situations efficiently, we need to understand two useful ATTRIB switches:

/d
/s
  • /d includes folders. Without it, attrib handles only files, as we saw in 4.2.
  • /s goes into every subfolder and processes the matching items there too.

To reach every file and every folder at every level, use both, as in /d /s. The best way to see this is on real items.

The setup

In drive E, I have a folder, Testing Folder 1, and two files, Song 1 and Song 2. The folder has subfolders and files inside it. Nothing is hidden. Hidden items are shown and the protected setting is off, which is why the two system folders, $RECYCLE.BIN and System Volume Information, are visible. Here’s drive E, with attrib and attrib /d.

Drive E and Command Prompt showing attrib and attrib /d output.

Plain attrib lists only files:

A                    E:\Song 1.mp3
A                    E:\Song 2.mp3

With /d, folders are included:

   SH                E:\$RECYCLE.BIN
A                    E:\Song 1.mp3
A                    E:\Song 2.mp3
   SH                E:\System Volume Information
                     E:\Testing Folder 1

Safety: Run these commands only on a test drive, and never at the root of your system drive. Each command reaches every item in the folder where you run it.

Step 1: files only

attrib +h

This hides the two files in the current folder.

Drive E with Song 1 and Song 2 shown with faded icons.

Step 2: adding /d

attrib +h /d

Now the folders directly in drive E are included too.

Drive E with all items faded and Command Prompt showing two Not resetting system file messages.

Everything directly in drive E is now hidden, and attrib printed:

Not resetting system file - E:\$RECYCLE.BIN
Not resetting system file - E:\System Volume Information

This message means attrib skipped those two items. It won’t change an item that has the System attribute unless the same command also clears S. That matches Microsoft’s documentation, and we’ll see the command that does clear it shortly.

Testing Folder 1 is hidden, but not what’s inside it.

Testing Folder 1 opened with its items at normal color.

Step 3: adding /s

attrib +h /d /s
Testing Folder 1 opened with its items faded.

Now the inner items are hidden too. Here’s attrib /d /s, which lists items from every level:

A  SH                E:\$RECYCLE.BIN\S-1-5-21-...\desktop.ini
   SH                E:\$RECYCLE.BIN\S-1-5-21-...
    H                E:\Testing Folder 1\One Movie\Another Folder
A   H                E:\Testing Folder 1\One Movie\The One.mp4
A   H                E:\Testing Folder 1\Hitman Manual.pdf
    H                E:\Testing Folder 1\One Movie
   SH                E:\$RECYCLE.BIN
A   H                E:\Song 1.mp3
A   H                E:\Song 2.mp3
   SH                E:\System Volume Information
    H                E:\Testing Folder 1

/d alone lists the items in drive E. Adding /s lists everything inside them as well.

Step 4: removing Hidden everywhere

attrib -h /d /s
Drive E with normal icons except two faded system folders, and the attrib messages.

Hidden is gone everywhere except on the two system folders, which attrib skipped with the same message.

Step 5: both attributes everywhere

attrib +h +s /d /s
Drive E with all items faded and an Access denied message.

Every item now has both attributes. The only error is Access denied – E:\System Volume Information. $RECYCLE.BIN was included.

Step 6: removing both everywhere

attrib -h -s /d /s
Drive E with normal icons except one faded system folder, and an Access denied messag.

Everything returns to normal except System Volume Information, which gives the same Access denied error.

CommandWhat it does
attrib +hHides the files in the current folder
attrib +h /dHides the files and folders in the current folder
attrib +h /d /sHides files and folders at every level
attrib -h /d /sRemoves Hidden at every level
attrib +h +s /d /sApplies Hidden and System at every level
attrib -h -s /d /sRemoves both at every level

One more example: the wildcard

All of these commands reach everything in the folder where you run them. To reach only what’s inside one folder, use the wildcard *, which matches every name. For example:

attrib +h +s "Testing Folder 1\*" /d /s

This sets both attributes on everything inside Testing Folder 1, at every level, but not on the folder itself.

Drive E with normal icons and the inside of Testing Folder 1 showing faded items

Everything in drive E looks normal, and only the items inside Testing Folder 1 are hidden. I won’t go further into wildcards here.

We now have the one command a whole drive needs. Next, let’s recreate the pen-drive problem.


6.2 Recreating the Hidden Pen-Drive Problem

I’ve connected a pen drive to my computer, and Windows has assigned it the drive letter G:. It holds some folders and files, and none of them has any attribute set. Here’s how This PC shows it, with its used-space bar, and the drive’s Properties.

This PC showing drive G with a used-space bar and its Properties window.

The drive properties show the following storage information:

  • Capacity: 28.8 GB
  • Free space: 20.6 GB
  • Used space: 8.22 GB

The drive’s file system is FAT32. As we saw in 3.2, a drive’s Properties has no Hidden box, so there’s no way to hide a drive’s contents from there. Both settings are at their defaults:

  • Show hidden items: off
  • Hide protected operating system files: on

Hiding everything with one command

Now I’ll apply both attributes to the whole pen drive, from its root, with the command from 6.1:

attrib +h +s /d /s
Command Prompt after attrib +h +s /d /s and an empty drive G window.

Everything disappears, and G: looks empty. The command printed no errors on this drive for System Volume Information folder. On drive E, which is NTFS, it printed Access denied for System Volume Information. This pen drive uses FAT32, which may be the reason, but I didn’t test that.

I observed two another interesting things:

  • Explorer updated immediately. I had Command Prompt and G: side by side, and the drive emptied as soon as I pressed Enter.
  • It wasn’t instant. My earlier tests used small folders and finished at once. This drive holds about 8 GB, and the command took roughly four to five seconds. I didn’t test this, but the time probably depends on how many items there are, not their size.

What the drive shows now

The pen drive looks empty. Let’s check the same two places as before.

This PC and Properties showing the same used space for drive G.

Nothing has changed except visibility. The drive still reports 8.22 GB used, but the file list is empty. And attrib /d shows:

   SH                G:\System Volume Information
   SH                G:\Movies
   SH                G:\Songs
   SH                G:\Photos
   SH                G:\Mix
A  SH                G:\Testing.txt
A  SH                G:\Setup.rar
A  SH                G:\Documents.docx
A  SH                G:\Hitman Manual.pdf

Every item in the root has both S and H. attrib /d /s would list far more, but it shows the same thing for every file and folder in the subfolders.

This is exactly the puzzle from the Introduction: a pen drive that reports used space and looks empty. A pen drive can end up like this when a program on another computer sets these attributes on everything, and malware is one possible cause.

We simulated it with a single command on a test drive, and you should never use real malware to try it. An empty-looking drive can have other causes too, such as a damaged file system, so this is one possibility, not a diagnosis.

Next, in 6.3, we’ll solve it, starting the way an ordinary user would and then moving to the command line.


6.3 Solving the Problem

Let’s assume we have just connected the pen drive and Windows has assigned it the drive letter G:.

It looks empty, but its Properties report 8.22 GB used. That’s a hint that the drive holds data that isn’t showing.

Empty drive G and its Properties window showing 8.22 GB used.

What the drive’s details show

Before touching any setting, here’s something I found during testing. In the drive’s Properties, the General tab has a Details button next to the capacity graph. [I found this in Windows 11, and it may or may not exist in older versions. The same breakdown is available in Settings → System → Storage by selecting the drive.]

General tab of the pen drive's Properties with the Details button highlighted.

It opens the Storage settings for this pen drive.

Windows storage settings showing 8.22 GB used of 28.8 GB with categories.

The drive is named PEN DRIVE (G:) and it’s 28.8 GB. It shows 8.22 GB used and 20.6 GB free, out of 28.8 GB in total, split into categories:

CategorySize
Videos4.76 GB
Music3.03 GB
Pictures433 MB
System & Reserved1.53 MB
Other48.0 KB

The categories add up to the used space. So the data is real, it’s mostly videos, music, and pictures, and it’s on the drive even though nothing is visible.

The ordinary route

The first idea is that the items are hidden, so I’ll turn on hidden items.

Drive G still empty after turning on hidden items.

The drive is still empty. A curious user might learn there’s a second layer, the protected setting from 5.1. I’ll untick Hide protected operating system files.

Drive G listing folders and files with faded icons.

Everything appears, faded. Next, the natural step is to remove the hidden attribute. The drive’s Properties has no Hidden box, since it’s a drive, so a user would try each item separately. They’d find the Hidden box ticked and greyed out.

Properties of the Movies folder with a greyed-out Hidden check box.

As we saw in 5.3, the System attribute locks that box, so the graphical route is closed.

The fix: attrib

Now the command line. I’ll open Command Prompt, move to the pen drive, and check that the prompt shows G:\ before I press Enter:

attrib -h -s /d /s
Command Prompt in G: after attrib -h -s /d /s and drive G with normal icons.

Everything returns to normal. To confirm, I opened files, folders, images, and media, and everything worked normally. attrib /d now shows:

                     G:\System Volume Information
                     G:\Movies
                     G:\Songs
                     G:\Photos
                     G:\Mix
A                    G:\Testing.txt
A                    G:\Setup.rar
A                    G:\Documents.docx
A                    G:\Hitman Manual.pdf

No item has Hidden or System, and that includes System Volume Information, which also lost both attributes. On drive E, which is NTFS, that folder refused the same command with Access denied, and this pen drive is FAT32, as I suggested earlier. I didn’t test an NTFS pen drive, so that’s still a guess.

That’s how the puzzle from the Introduction is solved. The files weren’t missing, the drive wasn’t faulty, and nothing was corrupted. Every item carried both Hidden and System, and the two settings kept them out of sight.

Edge cases

Important Precautions and Possible Errors

  • Check the prompt first. The fix reaches everything in the folder where you run it. Make sure it says G:\ (your pen drive) before pressing Enter, and never run it at the root of your system drive.
  • Everything becomes visible. If you want something hidden again, use attrib +h on it, or the wildcard form from 6.1 for a single folder.
  • System Volume Information. On an NTFS drive you may see Access denied for it. Ignore it, since the rest of the command still works. On my FAT32 drive there was no message.
  • $RECYCLE.BIN. Pen drives usually don’t have one, so there’s nothing to do.
  • Errors on some items. If attrib command shows error, In two or three cases of my own, copying the item to another drive and removing the attributes there worked. I don’t know why, so treat it as an experience and not a rule. Copy rather than move, and keep the originals until the copies open.
  • No used space. If the drive reports little or none, the data may genuinely be gone, and this fix won’t help.
  • Shortcuts instead of folders. If you see shortcuts with folder names, don’t open them. Scan the drive first.
  • Scan before opening. If the drive came from an unknown computer, scan its files before you open them.

We’ve solved the pen-drive case. Along the way, a few assumptions turned out to be wrong: that hidden means protected, that hidden items can’t be reached, and more. The last part collects these as short questions and answers.


Part 7: Common Misconceptions and FAQs

This part collects the wrong assumptions we ran into, and the questions readers are most likely to ask. The numbers in brackets point to the section where each one is explained or tested.

Common Misconceptions

  • “Hidden items are moved to a secret place.” They stay exactly where they are. Only one attribute changes. )
  • “Hidden is a kind of file.” It’s a flag that any item can carry, on any file type.
  • “Every file and folder has a usable Hidden box.” It depends on where the item is stored. On a phone folder, the box is greyed out.
  • “Hiding a folder hides everything inside it, including items added later.” Only the “subfolders and files” option reaches what’s inside, and only for items that exist at that moment.
  • “An unticked Hidden box on a folder means nothing inside is hidden.” The box shows the folder’s own attribute only.
  • “Items on the Desktop are exempt.” They aren’t.
  • “The setting travels with the drive.” The setting belongs to each user account. The attribute travels with the item.
  • “Archiving a hidden file keeps it hidden.” In my tests, that depended on the tool.
  • “Hidden items vanish from search and recent lists.” That depends on the tool, and on whether the item was listed before it was hidden.
  • “A hidden file can’t be opened.” Typing its path, or using an app’s own recent list, can open it.
  • “The System attribute hides a file.” On its own it doesn’t. It locks the Hidden box. Together with Hidden, it makes the item protected.
  • “A .sys file, or any Windows file, has the System attribute.” An extension or origin isn’t the attribute.
  • “‘Protected’ means safe from changes.” The word describes the hiding.
  • “A pen drive that looks empty but reports used space is faulty.” It may simply carry Hidden and System on every item.

FAQs

  • Why is the Hidden box greyed out? If the System attribute is set, it locks the box. It can also be greyed out for other reasons, such as on a phone folder or inside the Recycle Bin.
  • Why does a drive show used space but look empty? Every item may be hidden, and the drive’s Properties still counts them.
  • Why is my pen drive still empty with hidden items on? If the items carry both Hidden and System, you also need to turn off “Hide protected operating system files.”
  • Does attrib show hidden files even if Explorer hides them? Yes. It reads attributes directly.
  • What does “Not resetting system file” mean? attrib skipped an item that has the System attribute, because your command didn’t also clear it.
  • Why did one drive give Access denied for System Volume Information and another didn’t? I don’t know for certain. My NTFS drive refused, and my FAT32 pen drive didn’t. The file system may be the reason, but I didn’t test it.
  • Can I remove the System attribute from any item? No. Items I made lost it, but some real system items refused.
  • If I hide a folder, are files I add later hidden? No. The attribute applies only to what’s there when you apply it.
  • Will a hidden file stay in my Recent list? If it was listed before you hid it, yes. If you open it after hiding it, the entry follows the setting.
  • Can a hidden folder absorb files I copy? Yes. Copying a same-named folder into its location merges silently by default.
  • Does a hidden folder’s name still autocomplete in the address bar? In my testing, yes, even with the setting off.
  • Is hiding a way to keep files secret or safe? No. Hidden items can be opened by path, found by other tools, and listed by attrib.

Summary & Conclusion

Summary

  • Hidden is an attribute, a flag that belongs to the item and lives in the file system. It isn’t a place or a file type.
  • The Hide/Show setting belongs to the user, while the attribute belongs to the item. You change the setting in File Explorer Options or with the View toggle.
  • Hiding and unhiding works the same way for files and folders, except that a folder with items inside asks how far to apply it. The attribute applies only to what exists at that moment.
  • Phones show the Hidden box greyed out, because the attribute depends on the file system.
  • Hidden items still count in sizes and used space, and they can still be copied, searched, listed, and opened by path.
  • Lists behave differently. Recent and pinned entries depend on whether the item was hidden when it was added, and other apps keep their own lists.
  • attrib reads and changes attributes from the command line, and shows hidden items whatever the setting. /d includes folders and /s goes into subfolders.
  • System is a second attribute. On its own it doesn’t hide anything, but it locks the Hidden box. Hidden plus System makes an item protected, and it needs both settings changed to appear.
  • “Protected” describes the hiding, not what you’re allowed to do. Some real system items refuse to be changed, and our own items didn’t.
  • The pen-drive puzzle is solved by turning off both settings and running attrib -h -s /d /s from the drive’s root.

Conclusion

This lesson started as a follow-up to the File Explorer Options lesson, about one setting. It became a lesson about an attribute, because the setting is only a switch, and the real subject is the flag behind it. Along the way we went from a checkbox to a command line, and from a single hidden file to a pen drive that looked empty while reporting 8.22 GB of data.

Several things surprised me. A folder hidden with “subfolders and files” doesn’t hide what you add later. A file can stay in the Recent list after it’s hidden, or disappear from it, depending on the order I did things in. A folder’s name can autocomplete even when it’s hidden, and a media player opened a hidden file from its own list. The System attribute, which I expected to hide things, turned out to do something else: it locks the Hidden box.

I also have to be honest that I wasn’t right about everything. I assumed the confirmation window appears whenever you hide a folder, until I tried a single empty folder and saw that it doesn’t. I believed that new items would be hidden automatically, and I was wrong about that too. I expected attributes to behave the same everywhere, and the phone and the Recycle Bin showed otherwise. In a few places, like the extension display on system files and the file I copied between drives, I got results I couldn’t explain, so I left them out instead of guessing. Where I couldn’t find official documentation, I marked the result as an observation.

If you run these practicals yourself, you may see something different, and I’d like to hear about it. Everything here was tested on a few machines and one pen drive, and that’s the most I can claim.





Leave a comment