Articles in categories

Articles

Add key to registery with script on Windows

I needed to add a new key to my Windows registery to try something.

Here's how to do it.

[KEY_NAME]
"MyApplication.exe"=dword:270f
"MyApplication.exe"="TestValue"

If your value is a text value you need to put it between double quotes (e.g. "TestValue").

This is the content of my .Reg file. I used to force the WPF WebControl component to use IE9 instead of out of the box IE7.
Copy it in a text editor and save it as a .reg file. Then you can run it with a double click.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION]
"MyApplication.exe"=dword:270f

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION]
"MyApplication.exe"=dword:270f

Note the registry file should contain a blank line at the bottom of the file.

More info about creating, editing and deleting registery keys.

http://ss64.com/nt/regedit.html

http://www.robvanderwoude.com/regedit.php