键盘忍者:在Windows中使用快捷键切换文件扩展名显示

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-2 15:53   2337   0

Have you ever wanted to be able to easily toggle the visibility of file extensions? We’ve shown you how to toggle hidden files before, and now we’ve come up with a similar solution for file extensions.

您是否曾经想过能够轻松切换文件扩展名的可见性? 之前,我们已经向您展示了如何切换隐藏文件 ,现在我们针对文件扩展名提出了类似的解决方案。

If hotkeys are your game, be sure and check out our 21 keyboard shortcut articles.

如果热键是您的游戏,请确保并查看 我们的21个键盘快捷键文章

Toggle File Extensions

切换文件扩展名

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

下载并运行该应用程序后,您需要做的就是在打开任何文件夹时按下Win + Y快捷键:

image

And you’ll immediately see the file extensions, or won’t see them – the point is that it will toggle between the two settings.

而且您会立即看到文件扩展名,或者看不到文件扩展名–关键是它会在两个设置之间切换。

image

Using the same hotkey sequence you can bring the file extensions back.

使用相同的热键顺序,您可以恢复文件扩展名。

Installing the Hotkey

安装热键

To make this run at startup, you have to save and extract the downloadable file, and then create a shortcut in your startup folder, which can be accessed by putting the following into the location bar:

要在启动时运行此程序,必须保存并解压缩可下载的文件,然后在启动文件夹中创建一个快捷方式,可通过将以下内容放入位置栏中来访问该快捷方式:

shell:startup

shell:启动

You’ll notice the ToggleFileExt item that I added into the startup folder.

您会注意到我添加到启动文件夹中的ToggleFileExt项。

image

There’s no UI for this application, and it’ll run completely in the background with fairly low memory usage.

该应用程序没有UI,它将在后台以较低的内存使用量完全运行。

image

Using the AutoHotkey Version

使用自动热键版本

If you are already an AutoHotkey user and would like to just add this to your current script, the full source code is here:

如果您已经是AutoHotkey用户,并且只想将其添加到当前脚本中,则完整的源代码在此处:

; WINDOWS KEY + Y TOGGLES FILE EXTENSIONS

; WINDOWS KEY + Y切换文件扩展名

#y::RegRead, HiddenFiles_Status, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, HideFileExtIf HiddenFiles_Status = 1 RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, HideFileExt, 0Else RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, HideFileExt, 1WinGetClass, eh_Class,AIf (eh_Class = “#32770” OR A_OSVersion = “WIN_VISTA”)send, {F5}Else PostMessage, 0x111, 28931,,, AReturn

#y :: RegRead,HiddenFiles_Status,HKEY_CURRENT_USER,Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ Advanced,HideFileExtIf HiddenFiles_Status = 1 RegWrite,REG_DWORD,HKEY_CURRENT_USER,Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ Advanced,HideFileDet,0 ,HKEY_CURRENT_USER,Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ Advanced,HideFileExt,1WinGetClass,eh_Class,AIf(eh_Class =“#32770”或A_OSVersion =“ WIN_VISTA”)发送,{F5}其他PostMessage,0x111、28931,回报

Note: If the script doesn’t work for you, you can grab a text version here.

注意:如果脚本不适合您,您可以在此处获取文本版本

This isn’t the type of utility that I would end up using all the time, but it works great as part of my regular AutoHotkey toolkit.

这不是我会一直使用的实用程序类型,但是它可以作为常规AutoHotkey工具箱的一部分很好地工作。

Download ToggleFileExt Hotkey Application

下载ToggleFileExt热键应用程序

翻译自: https://www.howtogeek.com/howto/windows-vista/keyboard-ninja-toggle-file-extension-display-with-a-shortcut-key-in-windows/

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP