键盘忍者:在Windows中使用快捷键切换隐藏文件

We’ve written a very long time ago about how to toggle hidden files in Ubuntu with a simple shortcut key. But what about keyboard ninjas using Windows instead? After doing some research, I’ve got a simple downloadable solution for you.

我们很久以前就写过有关如何使用简单的快捷键在Ubuntu中切换隐藏文件的信息 。 但是使用Windows代替键盘忍者呢? 经过研究,我为您提供了一个简单的可下载解决方案。

What I’ve done is throw together a very simple application that runs in the background and assigns the hotkey Win+H to toggle hidden files. There’s no user interface to keep it from wasting memory, but you can always customize it using the AutoHotkey script provided below instead.

我要做的是将一个非常简单的应用程序组合在一起,该应用程序在后台运行,并分配Win + H热键来切换隐藏文件。 没有用户界面可以防止浪费内存,但是您始终可以使用下面提供的AutoHotkey脚本自定义它。

Note: This application was based on an AutoHotkey script created by Lifehacker commenter turnersd, fully credited below.

注意:此应用程序基于Lifehacker评论者turnersd创建的AutoHotkey脚本,下面对此进行了详细介绍。

Toggle Hidden Files

切换隐藏文件

Once you’ve downloaded and run the application, all you have to do is hit the Win+H shortcut key while you have any folder open:

下载并运行该应用程序后,只要打开任何文件夹,只需按Win + H快捷键:

image

And presto! You’ll immediately see any hidden files in that folder, or any folders that are open.

和presto! 您将立即看到该文件夹​​中的所有隐藏文件,或打开的所有文件夹。

image

Hit the same hotkey sequence again, and the hidden folders will disappear again. Very useful!

再次按相同的热键顺序,隐藏的文件夹将再次消失。 很有用!

Installing the Hotkey

安装热键

In order to install this and set it up to run at startup, you’ll need to save and extract the downloadable file, and then create a shortcut in your startup group, which you can easily access by typing the following into the location bar:

为了安装此程序并将其设置为在启动时运行,您需要保存并解压缩可下载文件,然后在启动组中创建一个快捷方式,您可以通过在位置栏中键入以下内容来轻松访问该快捷方式:

shell:startup

shell:启动

You could even just copy the executable in… but either way, once you’ve done that, you can double-click on it to start it.

您甚至可以仅以以下方式复制可执行文件…,但是无论哪种方式,一旦完成,您都可以双击它来启动它。

image

Note that there’s no UI for this application, it runs completely in the background to limit memory usage as much as possible.

请注意,此应用程序没有UI,它完全在后台运行以尽可能限制内存使用。

Killing the Process

杀死进程

Because there’s no UI, if you want to stop the application from running, you’ll need to either reboot… or use the much simpler method of opening Task Manager, finding the ToggleHiddenFiles.exe process and killing it.

由于没有UI,因此如果要停止运行该应用程序,则需要重新启动…或使用更简单的方法打开“任务管理器”,找到ToggleHiddenFiles.exe进程并杀死它。

image

Using the AutoHotkey Script Instead

改用AutoHotkey脚本

The method for creating the hotkey isn’t something that I can take credit for… the credit should be fully given to Lifehacker commenter turnersd in this article about toggling hidden files with a shortcut.

创建快捷键的方法不是我值得赞扬的东西。在本文中, 有关使用快捷键切换隐藏文件的信息,应该完全归功于Lifehacker评论者turnersd

Here’s the source code, which you can copy into an AutoHotkey script file:

这是源代码,您可以将其复制到AutoHotkey脚本文件中:

; WINDOWS KEY + H TOGGLES HIDDEN FILES
#h::
RegRead, HiddenFiles_Status, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden
If HiddenFiles_Status = 2 
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden, 1
Else 
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden, 2
WinGetClass, eh_Class,A
If (eh_Class = "#32770" OR A_OSVersion = "WIN_VISTA")
send, {F5}
Else PostMessage, 0x111, 28931,,, A
Return

; WINDOWS KEY + H TOGGLES HIDDEN FILES
#h::
RegRead, HiddenFiles_Status, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden
If HiddenFiles_Status = 2
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden, 1
Else
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden, 2
WinGetClass, eh_Class,A
If (eh_Class = "#32770" OR A_OSVersion = "WIN_VISTA")
send, {F5}
Else PostMessage, 0x111, 28931,,, A
Return

If you have problems with this source, you can also grab it from the textsnip site.

如果您对此源有疑问,也可以从textsnip网站上获取它

Downloadable Application

可下载的应用程序

Just remember to extract this file and save it somewhere where it won’t be deleted later. I usually create a folder under my user directory for applications and save them there.

只要记住要提取该文件并将其保存在以后将不会删除的位置即可。 我通常在用户目录下为应用程序创建一个文件夹,并将其保存在该文件夹中。

Download ToggleHiddenFiles Hotkey Application

下载ToggleHiddenFiles热键应用程序

翻译自: https://www.howtogeek.com/howto/keyboard-ninja/keyboard-ninja-toggle-hidden-files-with-a-shortcut-key-in-windows/

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值