Windows Vista: Using VirtualRegistry to Redirect Registry Keys

Here's an article on using VirtualRegistry to provide version lies when an application is looking for the version of the operating system in the registry instead of using one of the GetVersion APIs. I could go on and on about all of the other command line arguments that do interesting things, but that is actually […]

Here's an article on using VirtualRegistry to provide version lies when an application is looking for the version of the operating system in the registry instead of using one of the GetVersion APIs. I could go on and on about all of the other command line arguments that do interesting things, but that is actually the subject of a forthcoming update to the help file itself, so I'm going to focus on the interesting ones here.

Probably the most interesting one is the command line argument that allows you to redirect any one key to any other key. Why is this one so compelling? Because it can resolve almost every issue you could possibly come across.

You see, the rest of the command line arguments do specific fixes. They can pretend that certain keys exist, and that they have certain values. They can redirect registry keys to other places. But you have to get lucky and happen to find one that is redirecting the keys you need to a place that works for you. In the case of version lies, this is something that comes up quite a lot, and you can completely re-use that. There are command line arguments around various versions of DirectX and codecs, all of which either redirect or pretend.

But redirection can be a form of pretending. If you want the version to say 5.0, but it says 6.0, if you know the command line NT50 that's a very effective way to do that. But, what if you didn't know this command line (which until recently is probably the case)? What if there is an existing command line for a problem you have, but you don't happen to know that one, and I haven't talked about that yet? You can achieve the same effect using redirection.

For installation, I simply repackage the application so I create a new key that contains the value 5.0. I redirect the key I'm looking for, say HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\Current Version, to HKEY_LOCAL_MACHINE\Software\My Company\Vendor\App\Nt Current Version, and then populate that key with the value of 5.0. I then redirect to this new key, and voila - I get the same version lie.

Yes, it requires me to drop a key, but you can see that I can create whatever I need, and use redirection both for redirecting to user-writeable locations as well as lying about existing values (which don't need to be user-writeable necessarily).

That being said, what's the command line to use?

Full Article

Microsoft, Windows Vista, VirtualRegistry, Windows Registry, Tips and Tricks, Knowledgebase, Article