windows 切换命令行_如何使用命令行切换显示或隐藏Windows隐藏文件?

windows 切换命令行_如何使用命令行切换显示或隐藏Windows隐藏文件?

windows 切换命令行

windows 切换命令行_如何使用命令行切换显示或隐藏Windows隐藏文件?

While most of us never need to see or access the hidden files on our Windows systems, others may need to work with them more often. Is there an easy way to toggle back and forth between showing and hiding hidden files? Today’s SuperUser Q&A post has the solution to a frustrated reader’s problem.

尽管我们大多数人都不需要查看或访问Windows系统上的隐藏文件,但其他人可能需要更频繁地使用它们。 有没有一种简单的方法可以在显示和隐藏隐藏文件之间来回切换? 今天的“超级用户问答”帖子提供了解决沮丧的读者问题的方法。

Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.

今天的“问答”环节由SuperUser提供,它是Stack Exchange的一个分支,该社区是由社区驱动的Q&A网站分组。

问题 (The Question)

SuperUser reader RogUE wants to know how to show or hide Windows hidden files via a command line toggle:

超级用户阅读器RogUE想知道如何通过命令行切换显示或隐藏Windows隐藏文件:

I often need to toggle between showing and hiding the hidden files on my Windows system. I have been doing it the usual way:

我经常需要在Windows系统上显示和隐藏隐藏文件之间切换。 我一直按照通常的方式做:

  • Click Organize in an Explorer Window

    单击在浏览器窗口中组织
  • Select Folder and Search Options

    选择文件夹和搜索选项
  • Switch to the View Tab

    切换到查看标签
  • Toggle between Show/Hide Hidden Files

    在显示/隐藏隐藏文件之间切换

This method is lengthy and I am tired of it. I would like the ability to toggle between showing and hiding them using the Command Line (CMD). Is there a way to set this up for regular files as well as system files?

这种方法很冗长,我对此感到厌倦。 我希望能够使用命令行(CMD)在显示和隐藏它们之间切换。 有没有办法针对常规文件和系统文件进行设置?

How do you show or hide Windows hidden files via a command line toggle?

如何通过命令行切换显示或隐藏Windows隐藏文件?

答案 (The Answer)

SuperUser contributor Steven has the answer for us:

超级用户贡献者史蒂文为我们提供了答案:

隐藏的文件,文件夹或驱动器 (Hidden Files, Folders, or Drives)

Add (or overwrite /f) the value Hidden to the registry key:

在注册表项中添加(或覆盖/ f )值Hidden

  • HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced

    HKCU \软件\ Microsoft \ Windows \ CurrentVersion \ Explorer \ Advanced

Show

显示

  • reg add “HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced” /v Hidden /t REG_DWORD /d 1 /f

    reg添加“ HKCU \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ Advanced” / v隐藏/ t REG_DWORD / d 1 / f

Do not Show

不显示

  • reg add “HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced” /v Hidden /t REG_DWORD /d 2 /f

    reg添加“ HKCU \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ Advanced” / v隐藏/ t REG_DWORD / d 2 / f

ToggleHiddenFiles.bat

ToggleHiddenFiles.bat

windows 切换命令行_如何使用命令行切换显示或隐藏Windows隐藏文件?

隐藏受保护的操作系统文件(推荐) (Hide Protected Operating System Files (Recommended))

Checked

已检查

  • reg add “HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced” /v ShowSuperHidden /t REG_DWORD /d 0 /f

    reg添加“ HKCU \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ Advanced” / v ShowSuperHidden / t REG_DWORD / d 0 / f

Unchecked

未检查

  • reg add “HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced” /v ShowSuperHidden /t REG_DWORD /d 1 /f

    reg添加“ HKCU \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ Advanced” / v ShowSuperHidden / t REG_DWORD / d 1 / f

ToggleSystemFiles.bat

ToggleSystemFiles.bat

windows 切换命令行_如何使用命令行切换显示或隐藏Windows隐藏文件?

Notes

笔记

The changes take place immediately. The program reg requires admin privileges, so the batch files must be run as administrator.

更改立即发生。 程序reg需要管理员权限,因此批处理文件必须以管理员身份运行。



Have something to add to the explanation? Sound off in the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.

有什么补充说明吗? 在评论中听起来不错。 是否想从其他精通Stack Exchange的用户那里获得更多答案? 在此处查看完整的讨论线程

翻译自: https://www.howtogeek.com/283251/how-do-you-show-or-hide-windows-hidden-files-with-a-command-line-toggle/

windows 切换命令行