Sometimes when working with Windows, you see all manner of names, abbreviations, and identifiers such as HKLM and HKEY_LOCAL_MACHINE for example. Is HKLM simply an alias for HKEY_LOCAL_MACHINE or are there ‘differences’ between the two? Today’s SuperUser Q&A post has the answers to a curious reader’s question.
Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.
Screenshot courtesy of wandersick (Flickr).
SuperUser reader Joe Kearney wants to know if HKLM is just an alias for HKEY_LOCAL_MACHINE or if there really are differences between the two at times:
HKLM is often used as an abbreviation for HKEY_LOCAL_MACHINE, but unexpectedly, this also appears to be true when I ask the Reg. for a value.
- C:\>reg query “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion” /v “CurrentVersion”
CurrentVersion REG_SZ 6.1
- C:\>reg query “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion” /v “CurrentVersion”
CurrentVersion REG_SZ 6.1
Are there any references asserting that they are equivalent or that one is an alias for the other? Or are there, in fact, cases where they are not the same thing?
Is HKLM simply an alias for HKEY_LOCAL_MACHINE or are there actually some differences between the two?
SuperUser contributors Twinkles and john smith have the answer for us. First up, Twinkles:
No, although HKLM is an abbreviation for HKEY_LOCAL_MACHINE, there is no official statement from Microsoft that it is always equivalent. In fact, it explicitly states that the availability of these shortcuts depend on the software being used and they are generally referred to as commonly used abbreviations.
There are cases where abbreviating HKEY_LOCAL_MACHINE to HKLM is not permitted, for instance when defining a policy.
Followed by the answer from john smith:
You also cannot use these abbreviations in .reg files, you have to write the full name inside the square scopes there.
Have something to add to the explanation? Sound off in the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.
- › Why Do I See “FBI Surveillance Van” in My Wi-Fi List?
- › Why Unlimited Mobile Data Isn’t Actually Unlimited
- › Here’s How Mozilla Thunderbird Is Making a Comeback in 2022
- › Using Wi-Fi for Everything? Here’s Why You Shouldn’t
- › MSI Clutch GM41 Lightweight Wireless Mouse Review: Versatile Featherweight
- › 5 Annoying Features You Can Disable on Samsung Phones