GetUSB.info Logo

How To: Hide Files on a USB Flash Drive

How To: Hide Files on a USB Flash Drive

close up picture of flash drive

This article, “How To: Hide Files on a USB Flash Drive,” explains two free methods to conceal files on a USB drive using built-in Windows features. One method is quick and basic; the other is more advanced and harder to detect.

Overview of the Two Methods

Method 1: Standard Hidden Attribute

This method is the easiest. Anyone can right-click a file or folder, go to Properties, and select the Hidden checkbox. This will hide the file unless a user has Windows configured to show hidden files.

Pros: Easy and fast
Cons: Easily bypassed

Method 2: System Hidden Attribute

This method hides a file using both the system and hidden attributes. Windows will not show these files—even if “Show hidden files and folders” is enabled—unless the user also disables “Hide protected operating system files.”

Pros: Harder to detect
Cons: Slightly more technical

How to Hide a File Using the Hidden Attribute

Right-click the file or folder ? Properties ? check the Hidden box ? click OK.

properties of hidden file on USB flash drive

If Windows is set to not show hidden files, it disappears from File Explorer. However, it still shows in the Command Prompt:

command line of hidden file on USB flash drive

If the user has “View hidden files and folders” enabled, the file is visible again:

show hidden files on USB flash drive

How to Use the System Hidden Attribute

Let’s take it a step further and apply the system attribute in addition to the hidden flag.

Step 1: Prepare the File

Place the file (e.g., text.txt) onto the USB flash drive.

Step 2: Open Command Prompt on the USB Drive

Click in the File Explorer address bar, type cmd, and hit Enter.

use command line to hide files on flash drive

Step 3: Apply the System Hidden Flags

At the prompt, type:

attrib +s +h D:\text.txt

Replace D:\ with your actual USB drive letter.

system hidden file property to hide file on a USB stick

Type exit to close the prompt. Then unplug and reconnect the USB drive. The file will now be invisible—even with hidden files shown—unless the system file setting is also disabled.

Confirming the Hidden File

Open Command Prompt and type:

dir /a:h

You’ll see hidden files listed—even the system hidden ones—but they won’t appear in File Explorer.

view system hidden file on USB drive

How to Open or Restore the Hidden File

Option 1: Show Protected Files (Not Recommended)

Enable “Hide protected operating system files” in Windows Explorer. This reveals system-hidden files but also exposes critical OS files to potential deletion.

Option 2: Remove Attributes

In Command Prompt, type:

attrib -s -h D:\text.txt

Option 3: Open Without Changing Attributes

To open the file without unhiding it, use:

notepad D:\text.txt

open hidden file on USB flash drive from command line

Need Stronger File Protection?

If you require stronger security, consider a Secure Disk solution. These USB flash drives hide entire partitions until a password is entered. They’re hardware-based, making them immune to software workarounds or hacks.

For more info, check out Nexcopy’s Secure Flash Drives.

Tags: , , , ,

Rich Gates

Administator for GetUSB.info GetUSB.info started in 2004 with the concept of providing USB information for everything USB related. At the time, USB was gaining momentum and every day new products, articles and news became published. Today, the site is focused on bringing technical information, tricks and hacks to USB related products. The site does publish off topic information as well, to keep the variety up. Please visit the footer area of any page if you or your company is interested in article or product placement via purchased advertising.

Copyright © 2006 +

USB Powered Gadgets and more...

All Rights Reserved

GetUSB Advertising

This is a high value website providing great exposure to your product and brand. Visit our advertising page to learn specifics.

For more information
Visit our advertising page.

Nexcopy Provides

USB copy protection with digital rights management for data loaded on USB flash drives.

Contact us learn more