This tutorial offers a step-by-step guide for how to hide a folder or file in Windows 10 by using CMD (Command Prompt). You can also learn how to show hidden files Windows 10 using CMD. To recover deleted or lost files on Windows 10 computer, a top free file recovery software from MiniTool is also provided.
If you want to hide some important folders and files on Windows 10 to keep them away from others’ sight, you can use Windows Command Prompt (cmd.exe) tool to easily and quickly hide a file or folder in Windows 10.
Check below how to hide a folder/file in Windows 10 using CMD, as well as check how to unhide or show hidden files in Windows 10 with Command Prompt when you want.
How to Hide a Folder (File) in Windows 10 Using CMD
Step 1. Open Windows Command Prompt
At first, you should open the cmd.exe. You have several ways to open it. The most common way is to press Windows + R keys at the same time to open Window Run dialog, type cmd in Run window, and press Ctrl + Shift + Enter to open elevated Command Prompt in Windows 10.
Step 2. Hide a Folder or File Using Attrib Command
Then you can type the command line below in Command Prompt window, and hit Enter to hide the target folder in Windows 10.
attrib +h c:\documents
In this command, “+” means setting an attribute, “h” refers to the hidden file attribute. You should replace “c:\documents” with the folder path and name you’d like to hide, e.g. f:\work. You can right-click the file or folder and choose Properties to check its location.
Alternatively, you can also type the command line cd file or folder path in Command Prompt, and hit Enter to go to the file/folder location, for instance, cd f:.
Then type the command line attrib +h work and hit Enter to hide the Work folder in F partition.
Tip: To hide a file in Windows 10 with CMD, you should also include the file extension after the file name in the command line, e.g. f:\work.xls.
Thus, you won’t see the hidden file or folder in your Windows 10 computer.
This post teaches you how to show/view folder size in Windows 10 File Explorer if Windows folder size is not showing. 4 ways are included.
How to Unhide a Folder in Windows 10 with CMD
To show hidden files Windows 10, you can still use the attrib command in Command Prompt to easily realize it.
Step 1. Follow the same instructions above to enter into Command Prompt window.
Step 2. Type the command line attrib -h f:\work and hit Enter to make the hidden Work folder in F partition visible again. You should replace “f:\work” with the exact path of the folder you’d like to unhide. If it’s a single file you want to unhide, you should also add the file extension after the file name in the attrib command.
Best Free Way to Recover Deleted/Lost Files on Windows 10
Here, we also introduce an easy-to-use, clean and free data recovery software to you to help you recover any lost or deleted files on Windows 10/8/7 computer.
MiniTool Power Data Recovery helps you recover data from computer local hard drive, external hard drive, SSD, USB flash drive, SD card, and more with ease. Its free edition allows you to recover up to 1GB data for free.
Free pen drive data recovery. Easy 3 steps to recover data/files from pen drive for free (incl. corrupted, formatted, not recognized, not showing pen drive).
Easy user guide: You can just connect your device and launch MiniTool Power Data Recovery, choose the target device in its main UI, and click Scan button, it will automatically scan the data on the target device. After the scanning is completed, you can easily find your lost/deleted files and click Save button to store the recovered files to a new destination.