Windows 10 提供了一个选项来显示默认情况下看不到的隐藏文件和文件夹。(hidden files and folders)启用此选项后,文件资源管理器(File Explorer)将开始显示所有隐藏项目。
您可以在文件资源管理器(File Explorer)以及PowerShell和命令提示符(Command Prompt)等命令行工具中查看隐藏的文件和文件夹。
在文件资源管理器中显示隐藏的文件和文件夹(Show Hidden Files and Folders in File Explorer)
按照以下步骤配置文件资源管理器(File Explorer)以显示目录中的所有隐藏内容。
- 打开开始(Start)菜单,搜索这台电脑(This PC),然后在搜索结果中选择这台电脑。(This PC)
- 选择“这台电脑”窗口顶部的“查看”选项卡。(View)
- 在屏幕右侧,启用隐藏项目(Hidden items)复选框。
- 文件资源管理器(File Explorer)将开始显示您计算机上的隐藏文件和文件夹。
- 要重新隐藏您的项目,请取消选择文件资源管理器中的隐藏项目(Hidden items)框。
从控制面板显示隐藏的文件和文件夹(Show Hidden Files and Folders From Control Panel)
如果您更喜欢控制面板(If you prefer the Control Panel),您可以使用此实用程序中的选项让Windows 10显示隐藏的文件和文件夹。
- 访问开始(Start)菜单,搜索控制面板(Control Panel),然后在结果中选择实用程序。
- 在控制面板中,选择(Control Panel)查看方式(View by)旁边的菜单并选择类别(Category)。
- 选择外观和个性化(Appearance and Personalization)选项。
- 选择文件资源管理器选项(File Explorer Options)下的显示隐藏文件和文件夹(Show hidden files and folders)。
- 您现在位于“文件资源管理器选项(File Explorer Options)”窗口的“查看”(View)选项卡中。在这里,选择显示隐藏的文件、文件夹和驱动器(Show hidden files, folders, and drives)选项。选择应用(Apply),然后选择确定(OK)。
- Windows文件资源管理器(File Explorer)现在将显示所有隐藏的文件和文件夹。
- 要隐藏隐藏的项目,请选择不显示隐藏的文件、文件夹或驱动器(Don’t show hidden files, folders, or drives)选项。然后,选择Apply和OK。
从设置中显示隐藏的文件和文件夹(Show Hidden Files and Folders From Settings)
Windows 10 的设置(Settings)应用程序还包括在您的 PC 上显示隐藏内容的选项。(show hidden contents)
要使用此方法:
- 按Windows + I键启动“设置”应用程序(Settings app)或搜索并在“开始(Start)”菜单中选择“设置” 。(Settings)
- 如果您不在步骤 3(Step 3)中显示的主设置页面,请选择主页(Home)按钮。
- 选择更新和安全(Update & Security)。
- 从左侧边栏中选择面向开发人员。(For developers)
- 向下滚动右窗格以更改设置以显示隐藏文件和系统文件。(Change settings to show hidden and system files. )选择显示设置(Show settings)。
- 启用显示隐藏的文件、文件夹和驱动器(Show hidden files, folders, and drives)选项。然后,选择应用(Apply)并选择确定(OK)以保存您的设置。
在 PowerShell 中查看隐藏的文件和文件夹(View Hidden Files and Folders in PowerShell)
如果您更喜欢命令行方法,可以使用 Windows PowerShell 中的命令(use a command in Windows PowerShell)来检索所有隐藏文件和文件夹的列表。
- 单击(Click)开始或左下角的Windows(Start)图标(Windows Icon),然后键入PowerShell。从结果中选择Windows PowerShell 。
- 在 PowerShell 窗口中,键入cd,键入一个空格,然后输入隐藏文件所在文件夹的完整路径。例如,如果您的隐藏文件位于桌面(desktop)上名为MyDocuments的文件夹中,您将使用以下命令将USER替换为您的用户名。然后,按Enter。cd C:\Users\USER\Desktop\MyDocuments
- 键入dir -force并按Enter。这会显示您隐藏的文件和文件夹。
- 如果您不确定哪个文件夹包含隐藏文件,请键入cd,键入一个空格,输入其子文件夹可能包含隐藏文件的文件夹的完整路径,然后按Enter。然后,运行以下命令:
dir -recurse -force
- (Hidden)所选文件夹和子文件夹中的隐藏项目应显示在PowerShell窗口中。
请记住,此方法仅在PowerShell窗口中显示隐藏文件;它不会使隐藏的项目在File Explorer中可见。
在 Windows 命令提示符中查看隐藏文件(View Hidden Files in Windows Command Prompt)
查看隐藏文件和文件夹列表的另一种方法是使用命令提示符(use Command Prompt)。请按照以下步骤操作:
- 按Windows键打开开始(Start)菜单,搜索命令提示符(Command Prompt),然后在搜索结果中选择实用程序。
- 键入cd,键入一个空格,然后输入存储隐藏文件的文件夹的完整路径。然后,按Enter。
- 键入dir /ah 以查看隐藏文件和文件夹的列表。
- 如果您不知道哪个文件夹包含隐藏文件,您可以对父文件夹运行隐藏文件扫描。这将扫描该主文件夹中的所有子文件夹。为此,请键入cd,键入一个空格,输入文件夹的完整路径,然后按Enter。然后,运行以下命令:
dir /ah /s
- 命令提示符(Command Prompt)窗口现在列出了指定文件夹和子文件夹中的隐藏项目。
上述方法不会对文件资源管理器(File Explorer)选项进行任何更改,仅列出隐藏文件。
显示隐藏的操作系统文件(Show Hidden Operating System Files)
即使您在文件资源管理器(File Explorer)中启用隐藏文件选项,某些操作系统文件也不会出现。请按照以下步骤打开单独的选项以查看这些隐藏的操作系统文件:
- 按Windows键打开“开始(Start)”菜单,键入“显示隐藏文件(Show hidden files)”,然后在搜索结果中选择该选项。
- 滚动到更改设置以显示隐藏文件和系统文件(Change settings to show hidden and system files),然后选择显示设置。(Show settings.)
- 向下滚动到隐藏受保护的操作系统文件(推荐)(Hide protected operating system files (Recommended))。取消选中此选项的复选框。
- 如果弹出警告,请选择是。(Yes )然后,选择Apply和OK。
一个谨慎的词(A Word of Caution)
在 Internet 上,许多资源可能会要求您使用命令提示符(Command Prompt)或PowerShell中的(PowerShell)attrib命令来查看隐藏的项目。更改系统文件的属性(change the attribute)通常是不安全的,因为这可能会产生意想不到的后果。
请在下面的评论中告诉我们哪种方法适合您。
6 Ways to Show Hidden Files and Folders in Windows 10
Windows 10 offers an option to show hidden files and folders that you don’t see by default. Once you enable this option, File Explorer starts displaying all your hidden items.
You can view the hidden files and folders in both File Explorer as well as command-line tools like PowerShell and Command Prompt.
Show Hidden Files and Folders in File Explorer
Follow the steps below to configure File Explorer to show all hidden contents in your directories.
- Open the Start menu, search for This PC, and select This PC in the search results.
- Select the View tab at the top of the This PC window.
- On the right of your screen, enable the Hidden items checkbox.
- File Explorer will start displaying hidden files and folders on your computer.
- To re-hide your items, deselect the Hidden items box in File Explorer.
Show Hidden Files and Folders From Control Panel
If you prefer the Control Panel, you can use an option in this utility to get Windows 10 to display hidden files and folders.
- Access the Start menu, search for Control Panel, and select the utility in the results.
- In the Control Panel, select the menu next to View by and choose Category.
- Select the Appearance and Personalization option.
- Choose Show hidden files and folders under the File Explorer Options.
- You’re now in the View tab of the File Explorer Options window. Here, select the Show hidden files, folders, and drives option. Select Apply followed by OK.
- Windows File Explorer will now display all your hidden files and folders.
- To hide hidden items, select the Don’t show hidden files, folders, or drives option. Then, select Apply followed by OK.
Show Hidden Files and Folders From Settings
Windows 10’s Settings app also includes the option to show hidden contents on your PC.
To use this method:
- Press Windows + I keys to launch the Settings app or search and select Settings in the Start menu.
- Select the Home button if you’re not on the main settings page shown in Step 3.
- Select Update & Security.
- Select For developers from the left sidebar.
- Scroll down the right pane to Change settings to show hidden and system files. Choose Show settings.
- Enable the Show hidden files, folders, and drives option. Then, select Apply and select OK to save your settings.
View Hidden Files and Folders in PowerShell
If you prefer command-line methods, you can use a command in Windows PowerShell to retrieve a list of all your hidden files and folders.
- Click on Start or the Windows Icon on the bottom left and type PowerShell. Select Windows PowerShell from the results.
- In the PowerShell window, type cd, type a space, and then enter the full path of the folder where your hidden files are located. For example, if your hidden files are in a folder called MyDocuments on your desktop, you’d use the following command replacing USER with your username. Then, press Enter.
cd C:\Users\USER\Desktop\MyDocuments
- Type dir -force and press Enter. This reveals your hidden files and folders.
- If you aren’t sure what folder contains the hidden files, type cd, type a space, enter the full path of the folder whose subfolders could have the hidden files, and press Enter. Then, run this command:
dir -recurse -force
- Hidden items in the selected folder and sub-folders should appear in the PowerShell window.
Keep in mind that this method only shows hidden files in a PowerShell window; it doesn’t make hidden items visible in File Explorer.
View Hidden Files in Windows Command Prompt
Another way to view a list of hidden files and folders is to use Command Prompt. Follow the steps below:
- Press the Windows key to open the Start menu, search for Command Prompt, and select the utility in the search results.
- Type cd, type a space, and then enter the full path of the folder where your hidden files are stored. Then, press Enter.
- Type dir /ah to view a list of the hidden files and folders.
- If you don’t know what folder contains the hidden files, you can run a hidden file scan on a parent folder. This will scan all of the subfolders in that main folder. To do this, type cd, type a space, enter the full path of the folder, and press Enter. Then, run the following command:
dir /ah /s
- The Command Prompt window now lists the hidden items from the specified folder and sub-folders.
The above method doesn’t make any changes to File Explorer options and only lists the hidden files.
Show Hidden Operating System Files
There are certain operating system files that won’t appear even if you enable the hidden files option in File Explorer. Follow the steps below to toggle on a separate option to view these hidden OS files:
- Press the Windows key to open the Start menu, type Show hidden files, and select that option in the search results.
- Scroll to Change settings to show hidden and system files and select Show settings.
- Scroll down to Hide protected operating system files (Recommended). Uncheck the box for this option.
- Select Yes if a warning pops up. Then, select Apply followed by OK.
A Word of Caution
On the internet, many resources may ask you to use the attrib command from the Command Prompt or PowerShell to view your hidden items. It’s generally not safe to change the attribute of a system file as this may have unexpected consequences.
Do let us know, in the comments below, which method worked for you.