How to Hide Files or Folders Using Command Prompt or PowerShell
By Timothy Tibbetts |
Hiding files or folders from the File Explorer view is a great way to protect files from being deleted or found. Installing a third-party program can do the trick, although if you're trying to hide files from someone, it could tip them off. In this guide, we look at hiding files or folders using the Command Prompt or PowerShell. We recommend you use the Command Prompt as one command (list hidden files or folders) does not work in PowerShell.
Before we get started, keep in mind that some files and folders shouldn't be hidden including operating system files. Your best bet is to create a folder to hide to avoid any possible problems.
1: Hide Files or Folders
Open the Command Prompt or PowerShell. You'll want to know the path to the files or folders you want to hide. In our examples, we've created a folder called Hidden as an example.
To hide an individual file or folder in attrib +h C:\PathToTheFileOrFolder.
As you can see, our Hidden folder is now, well, hidden. We are assuming that you have show hidden files, folders, and drives off. Otherwise, they will still show up, but with a lighter colored folder as seen here:
Once you understand how to hide and unhide files and folders, see step 4 for how to Super Hide them.
To hide all files and subfolders in your target location, type in attrib +h C:\PathToTheFileOrFolder /s /d.
2: List Hidden Files or Folders
At some point, you might want to see the files or folders you've hidden. In this case, using the CD command to go to the hidden folder and type in dir /a:h. Note: This does not work in PowerShell.
3: Unhide Files or Folders
To unhide an individual file or folder type in attrib -s -h C:\PathToTheFileOrFolder
To unhide all files or folders type in attrib -s -h C:\Hidden\* /s /d
4: Super Hide Files or Folders
The only downside to this method is anyone who knows how to show hidden files, folders, and drives can still find your hidden files.
To completely hide files or folders (Super Hide) use attrib +s +h C:\PathToTheFileOrFolder.
Now your files are hidden even if hidden files and folders is enabled.
To unhide your files or folders, use attrib -s -h C:\PathToTheFileOrFolder.
comments powered by Disqus
Before we get started, keep in mind that some files and folders shouldn't be hidden including operating system files. Your best bet is to create a folder to hide to avoid any possible problems.
1: Hide Files or Folders
Open the Command Prompt or PowerShell. You'll want to know the path to the files or folders you want to hide. In our examples, we've created a folder called Hidden as an example.
To hide an individual file or folder in attrib +h C:\PathToTheFileOrFolder.
As you can see, our Hidden folder is now, well, hidden. We are assuming that you have show hidden files, folders, and drives off. Otherwise, they will still show up, but with a lighter colored folder as seen here:
Once you understand how to hide and unhide files and folders, see step 4 for how to Super Hide them.
To hide all files and subfolders in your target location, type in attrib +h C:\PathToTheFileOrFolder /s /d.
2: List Hidden Files or Folders
At some point, you might want to see the files or folders you've hidden. In this case, using the CD command to go to the hidden folder and type in dir /a:h. Note: This does not work in PowerShell.
3: Unhide Files or Folders
To unhide an individual file or folder type in attrib -s -h C:\PathToTheFileOrFolder
To unhide all files or folders type in attrib -s -h C:\Hidden\* /s /d
4: Super Hide Files or Folders
The only downside to this method is anyone who knows how to show hidden files, folders, and drives can still find your hidden files.
To completely hide files or folders (Super Hide) use attrib +s +h C:\PathToTheFileOrFolder.
Now your files are hidden even if hidden files and folders is enabled.
To unhide your files or folders, use attrib -s -h C:\PathToTheFileOrFolder.
comments powered by Disqus