Advertisement
Najeebsk

HIDE-AND-SHOW.ahk

May 5th, 2023
1,529
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ^h::   ;Toggle visibility of hidden files with Ctrl+H. Keep system files hidden.
  2.     RegRead, H, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden  
  3.     RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, ShowSuperHidden, 1
  4.     HiddenFiles(H, (H = 0 ? "" : "System & ") "Hidden files")
  5.     Return
  6.    
  7. !h::   ;Toggle visibility of  hidden files and system files with Alt+H.    
  8.     RegRead, H, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden  
  9.     RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, ShowSuperHidden, % (H = 2) ? 1 : 0  
  10.     HiddenFiles(H, "System & Hidden files")
  11.     Return    
  12. +h::   ;Toggle visibility of  hidden files with Shift+H.    
  13.    RegRead, H, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden  
  14.     RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, ShowSuperHidden, 0
  15.     HiddenFiles(H, (H = 2 ? "" : "System & ") "Hidden files")
  16.     Return
  17.        
  18. HiddenFiles(H, T) {
  19.     RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden, % (H = 2) ? 1 : 2
  20.     for window in ComObjCreate("Shell.Application").Windows
  21.         ControlSend, SysTreeView321, {f5}, % "ahk_id " window.hwnd
  22.     ControlSend,, {f5}, Program Manager ahk_exe explorer.exe
  23.     TrayTip, % T, % (H = 2) ? "Show" : "Hide", 1, 1
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement