Adjust Windows Registry Settings with the AutoHotkey RegRead and RegWrite Commands

Sometimes a Simple Script Offers the Best Way to Learn More Advance Techniques in AutoHotkey

I’ve just posted a script written years ago by Robert Ryan (the person responsible for the very capable RegEx Tester) which displays hidden files by changing settings in your Windows Registry—a trick you can apply to many other Windows settings if you know where to find them.

UnHideFilesThe problem with setting folders or files to Hidden in their Properties window (right-click on selected folder or filename in Windows File Explorer and click Properties at the bottom of the menu) involves losing sight of them forever. Since the listing disappears from view, you can forget that it even exists. Windows offers a multi-step procedure for making all Hidden folders/files visible, but who can remember that? This simple UnHideFiles.ahk script saves the stress.

The UnHideFiles.ahk Script

I call Ryan’s script UnHideFiles.ahk to make its purpose easily understood. It doesn’t change the Hidden Property setting of individual folders/files, but merely toggle them from invisible to visible—and back again. When set to ✔Show Hidden Files, any Hidden listing appears as a faded selection. (The script adds the checkmark (✔) after activating the setting.) When turned off, it disappears again.

UnHideFiles Shown
The Hidden folder appears as a faded listing in Windows File Explorer after selecting Show Hidden Files from the running UnHideFiles.ahk script.

The script uses the RegRead command to read the current settings in the Windows Registry and the RegWrite command to change that setting. Careful study of the code shows how Ryan does it. You can use the same technique for virtually any other Windows Registry setting—although some require rebooting your computer for them to take effect.

I put a shortcut to my copy in the Tools menu of my QuickLinks.ahk app. Since some of the Hotkeys might interfere with my other Hotkeys, I plan to load only when I need it.

jack

This post was proofread by Grammarly
(Any other mistakes are all mine.)

(Full disclosure: If you sign up for a free Grammarly account, I get 20¢. I use the spelling/grammar checking service all the time, but, then again, I write a lot more than most people. I recommend Grammarly because it works and it’s free.)

 

2 thoughts on “Adjust Windows Registry Settings with the AutoHotkey RegRead and RegWrite Commands

  1. Hi, Jack,

    Quick basic question: How do I create an array? I can’t find it in your book, and the AHK online help “Array” shows two examples, neither of which seem to work—I tried each, and every time they were flagged as “no value.” Can you give me a short example of a for-loop (or equivalent) using an array?

    Thanks!

    Tim Guymon

    norikus@cox.net

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s