autohotkey快捷键显示隐藏文件和文件扩展名

下面是我日常使用的ahk脚本中的一部分.

可以很方便的在资源管理器中使用快捷键显示隐藏文件或者文件扩展名, 提高工作效率.


#SingleInstance force      ;force a single instance
#HotkeyInterval 0          ;disable the warning dialog if a key is held down
#InstallKeybdHook          ;Forces the unconditional installation of the keyboard hook
#MaxThreads 20             ;use 20 (the max) instead of 10 threads
;#NoTrayIcon
#NoEnv
SetBatchLines, -1          ;makes the script run at max speed
SetKeyDelay , -1, -1       ;faster response (might be better with -1, 0)
DetectHiddenText, On
DetectHiddenWindows, On    ;detect hidden window

;;win7资源管理器的窗口类名, 如果是XP下, 需要修改
GroupAdd, Win7ShellClass, ahk_class WorkerW
GroupAdd, Win7ShellClass, ahk_class Progman
GroupAdd, Win7ShellClass, ahk_class CabinetWClass
GroupAdd, Win7ShellClass, ahk_class #32770


#IfWinActive,ahk_group Win7ShellClass
;;CTRL+Q显示隐藏系统文件
^Q::
RegRead,value,HKEY_CURRENT_USER,Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\, Hidden
If(value=1)
value = 2
Else
value = 1
RegWrite, REG_DWORD, HKEY_CURRENT_USER,Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\, Hidden, %Value%
RegWrite, REG_DWORD, HKEY_CURRENT_USER,Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\, ShowSuperHidden, %Value%-1
PostMessage,0x111,0x7103,0,SHELLDLL_DefView1,A
return
;;CTRL+W显示文件扩展名
^W::
RegRead,Value,HKEY_CURRENT_USER,Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\,HideFileExt
If(value=0)
value = 1
Else
value = 0
RegWrite, REG_DWORD,HKEY_CURRENT_USER,Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\,HideFileExt, %Value%
PostMessage,0x111,0x7103,0,SHELLDLL_DefView1,A
return
#IfWinActive


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值