How to Make Your Own Windows Registry Hacks

Over the years, we’ve created many Registry hacks to customize and tweak your Windows computer. Today we’re going to give you the keys to making your own registry hack files that you can use on any computer.

So what is a Registry Hack?

Whenever you customize a key or value in the registry, you could arguably call it a registry hack. But in this context, we’re referring to those downloadable registry hack files with the .reg extension that do magical things to your computer. Like break it. Be afraid.

In simpler terms, a registry hack file is a backup of all the changes that you’ve made to your registry, saved in a file so that you can apply those same changes to your computer should you reinstall, or on another computer when you get a new one.

Making a Registry Hack

Standard warning: Registry Editor is a powerful tool and misusing it can render your system unstable or even inoperable. This is a pretty simple hack and as long as you stick to the instructions, you shouldn’t have any problems. That said, if you’ve never worked with it before, consider reading about how to use the Registry Editor before you get started. And definitely back up the Registry (and your computer!) before making changes.

Once you’ve mucked around and changed the Registry values to your liking, you’ll want to use the Export feature to save everything out into a text file with the .reg extension — otherwise known as a registry hack file. These files follow a standard format, so you could probably create them from scratch if you really wanted to, but when you can export directly from the Registry Editor, why bother?

When exporting keys, you should make a point of drilling down to the lowest level on the left-hand side that you can get to while still seeing the value on the right-hand side that you’re trying to save into a file. Then right-click, choose Export, and then save it somewhere.

Now that you’ve successfully saved the file, you can either double-click it to merge the values back into the registry, which wouldn’t make sense right now, or copy it to another computer and merge the values into the registry, which would set the same values.

And in the case of this particular registry hack, that would work just fine because there is only a single value on the right — but most of the time, you’re going to need to edit the file. So right-click on it and choose Edit to open in Notepad.

And now we see the registry hack format, which is pretty simple, but requires a little explanation. Every registry hack contains this line at the top, which identifies it as a registry hack — without this line, it’s not going to work right.

Windows Registry Editor Version 5.00

You only need this line once in the file, and it must be the very first line. If you’re trying to combine more than one registry hack, keep that in mind — you only want it at the top line, once.

The next section can be as long or as short as your registry hack needs to go, and is arranged into sections for the Keys (the stuff on the left-hand side of the Registry Editor) and then a set of values for that key. For instance, if you had two keys that you wanted to set values for, you could have them each in the file like this — the SomeVariableName would be the value on the right-hand side under the SOMEKEYHERE that is on the left-hand side — and SomeValue would be underneath ANOTHERKEY.



We should really give you an example where you need to do some editing, so what we’ll do is open up the Registry Editor and browse down to the following key on the left-hand side. This key determines whether User Account Control blacks out the rest of the screen when the popup shows up, but that’s not important now.


Now go ahead and Export from the System key on the left-hand side, since that’s the lowest we can drill down while still seeing the key on the right. Open up the registry hack file and you’ll see a whole bunch of different stuff in it — yes, our PromptOnSecureDesktop is there in the file, but what about all the other stuff?

If you were to take this registry hack file to another computer and import it, everything else that was set on this machine underneath that Key would end up being set on the new computer. For instance, the EnableLUA key that you see in the file? That disables or enables UAC depending on how it is set. So if you just wanted to set the Secure Desktop value and didn’t want to change UAC on the other computer, you could inadvertently change that value too — along with everything else in the file.

Luckily there is a very simple answer: it’s a text editor! Just delete everything that isn’t the value or values you want to set. In our case we’ll delete everything but this single value, but if you had five settings in here you wanted to change, you could leave all five of them.

The important thing is that you don’t delete the first line, and you don’t delete the [HKEY_LOCAL_MACHINE\SOFTW….etc] line right above the value, because the Registry Editor needs to know where to put the value.

Combining Registry Hacks Together

Remember that first example with the NoAutoReboot stuff? That’s one of my favorite registry hacks. Now what if we wanted to include that one in our registry hack file along with the Secure Desktop stuff? Luckily, it’s simple, you just have to remember the rule: the Windows Registry Editor Version 5.00 line… only goes in the file once, at the top.

So if you copy and paste the two files into each other, and make sure that top line is only in there once, you’ll end up with a registry hack that contains both settings.

And you can do this as many times as you want — if you want to put every single tweak that you’ve ever done into a single file so that you can use it every time you reinstall, we’d be interested to hear about it.

Deleting a Registry Value

And now, the thing they don’t teach you in school… how to delete a registry value.

There are some scenarios where a registry hack entails creating a new key that didn’t exist before, and changing the setting back requires deleting that registry key. The way this works in registry hack land is pretty simple:

Export the key and change the value that it is set to so that it is just a minus sign. For instance:


Would become:


Not terribly hard once you do it once.

So what if you wanted to delete the registry Key instead of the value? You know, the stuff on the left-hand side of the Registry Editor? Again, it involves a minus symbol placed into a registry hack file. So if you wanted to delete the entire key shown in the above screenshot, you’d change it from this:


To this:


See that little minus sign? That will tell the Registry Editor to completely delete that key, and every value underneath it.

Here is some examples of registry hacks:

Add “Take Ownership” to Explorer Right-Click Menu in Windows

Taking ownership of system files or folders in Windows is not a simple task. Whether you use the GUI or the command line, it takes far too many steps. This method works in Windows Vista, 7, 8, 8.1, and 10, and it maybe works in XP, though you won’t need it there.

Here’s what the new right-click menu will look like after installing this registry hack. If you are in Windows 8, 8.1, or 10, the little shield won’t show up, but it’ll work just fine.

Note: you might need to hold down the Shift key to make the menu show up.

Copy and paste this in text document and save it as *.reg file

Windows Registry Editor Version 5.00
; Martin Micevski |

[HKEY_CLASSES_ROOT\*\shell\runas] @=”Take Ownership”

[HKEY_CLASSES_ROOT\*\shell\runas\command] @=”cmd.exe /c takeown /f \”%1\” && icacls \”%1\” /grant administrators:F”
“IsolatedCommand”=”cmd.exe /c takeown /f \”%1\” && icacls \”%1\” /grant administrators:F”

[HKEY_CLASSES_ROOT\Directory\shell\runas] @=”Take Ownership”

[HKEY_CLASSES_ROOT\Directory\shell\runas\command] @=”cmd.exe /c takeown /f \”%1\” /r /d y && icacls \”%1\” /grant administrators:F /t”
“IsolatedCommand”=”cmd.exe /c takeown /f \”%1\” /r /d y && icacls \”%1\” /grant administrators:F /t”

Double-click the *.reg file and click through the prompts. No reboot necessary.

Add “Defragment” to the Right-Click Menu for a Drive

After writing the article last week about how to add Disk Cleanup to the context menu for a drive, I received several requests for how to add another menu item for Defrag instead. With a simple registry hack we can do just that.

After manually applying or downloading the hack, you’ll have a new item on the right-click menu for your drives

Which will start up the command-line version of Disk Defragmenter (after accepting the UAC prompt)

Open up regedit.exe through the start menu search or run box, and then browse down to the following key:


Create a new key under shell called “runas”, and then set the (Default) value to “Defragment”. If you want to hide this menu item behind the Shift key right-click menu, then add a new string called Extended with no value.

Next, you’ll need to create a key called “command” and set the default value to the following, which is the command to run defrag with the default options but show verbose output.

defrag %1 -v

You can alternately choose from one of the other defrag switches here if you’d like.

Skip the Annoying “Use the Web service to find the correct program” Dialog (Windows 7)The registry hack will show you the second Open With dialog instead of that irritating first one.

If you’ve used Windows for any length of time, you’ve likely tried to open a file with an unknown extension. Instead of getting a list of programs to open the file with, you get an annoying dialog asking you to use a web service to find a program. So how do we change this?

You can use a registry hack to force Windows to skip this dialog altogether, and give you a list of applications to use to open the file instead, just as if you had selected the second option.

When you double-click on a file with an unknown extension, Windows presents you with this irritating dialog:

If you selected “Select a program from a list of installed programs”, you would get this much more useful dialog instead:

The registry hack will show you the second Open With dialog instead of that irritating first one.

Open regedit.exe through the start menu search or run box, and then browse down to the following key (create the key if it doesn’t exist)


Create a new 32-bit DWORD value on the right-hand side with the following values:

  • Name: NoInternetOpenWith
  • Value: 1

The change should be immediate, no need to restart anything. To reset back to default, set the value to 0 or delete the key.

Add Encrypt / Decrypt Options to Windows 7 / Vista Right-Click Menu

If you use the built-in file encryption in Windows 7 or Vista, you might be interested in adding an option to the right-click menu to more easily encrypt and decrypt your files, rather than having to use the file properties dialog.

Adding this to the menu couldn’t be simpler – there’s only a single registry key to add.

Open up regedit.exe through the start menu search box, and then find the following registry key:


In the right-hand pane, create a new 32-bit DWORD value called EncryptionContextMenu and give it a value of 1.

Now when you right-click on a file, you’ll see a new option called Encrypt.

When you choose this option, you’ll receive the following dialog, asking if you want to encrypt just the file, or also the parent folder. You can also choose just the file as the default.

Once the files are encrypted, you’ll notice that the title of the file is now green, indicating that it’s been encrypted. The right-click option will also now change to Decrypt.

How To Add Recycle Bin to “My Computer” in Windows 7 or Vista

Have you ever wanted to add the Recycle Bin to your My Computer screen? It’s probably not the most common request, but here’s how to do it anyway with a simple registry hack.

Here’s what we’re talking about… if you wanted to do something more useful, you can also add Control Panel to My Computer as well.

To make this tweak, we’ll be doing a quick registry hack, but there’s a downloadable version provided as well.

Open up regedit.exe through the start menu search or run box, and then browse down to the following key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\ CurrentVersion\Explorer\MyComputer\NameSpace

Now that you’re there, you’ll need to right-click and create a new key.

Name the key with the following text:


Once you are done, it should look like this:

Now you should be able to hit F5 on your My Computer screen, or close it and re-open.

How to Disable Caps Lock Key in Windows 7, 8, 10, or Vista

The caps lock key is a remnant of typewriters dating from the nineteenth century. Unless you’re in the accounting department, it’s probably not very useful, so today we’ll learn how to disable it.

Understanding How Windows Key Re-Mapping Works

Windows doesn’t have a default setting to allow for disabling the key, so what we have to do is re-map the key to something non-existent so as to completely disable it. To do this manually, you’d open up regedit.exe and browse down to the following key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout

Here’s the format of the binary data in the Scancode Map key, with the important parts in bold and various colors:

00000000 00000000 02000000 00003A00 00000000

Here’s how it works:

  • The first 16 zeros are just there to waste space.
  • The “02” in bold represents how many keys you are going to re-map plus 1. (It really represents the length of the data, but whatever)
  • The “0000” is the key we actually want Windows to map TO, which in this case is nothing, or 0.
  • The bolded “3A00” is the key we are mapping from, in this case the caps lock key.
  • The next 8 zeros are there to waste space as the null terminator.

You can map between multiple keys by incrementing the “02” and then adding another blocks in the middle. The 3A00 in the mix is the scan code. For example, if you wanted to disable the caps lock key and then change scroll lock into a caps lock key:

00000000 00000000 03000000 00003A00 3A004600 00000000

It might seem complicated, but it’s really fairly simple once you start working with it.

Make Your Taskbar Buttons Always Switch to the Last Active Window

To make clicking taskbar buttons open the last active window, you just need to make an adjustment to one setting in the Windows Registry. This works on PCs running Windows 7, 8, or 10.

Open the Registry Editor by hitting Start and typing “regedit.” Press Enter to open Registry Editor and give it permission to make changes to your PC.

In the Registry Editor, use the left sidebar to navigate to the following key:


Next you’re going to create a new value inside the Advanced key. Right-click the Advanced key and choose New > DWORD (32-bit) Value. Name the new value “LastActiveClick.”

Double-click the new LastActiveClick value to open its properties window. Change the value from 0 to 1 in the “Value data” box and then click “OK.”

You can now exit Registry Editor. You’ll need to sign out and back in (or restart your PC) for the changes to take place. You can test it by just popping open any app and opening several windows. Make a window from a different app active and then click the original app’s taskbar button. It should open the last window you worked on in that app.

To reverse the changes, just head back into the Registry and either change the LastActiveClick value back to 0 or delete the value entirely and then sign out and back into Windows.