. Home Feedback Contents Search

RegEdit Scripts 

Back Up Next

Obligatory Warning

The registry is the heart of the system. If you mess up your registry, it is possible to mess up Windows to the point that it won't work. Make darned sure that you have a registry backup.

Terms

Registry terms are not quite what you'd expect so here's a quick rundown.

  • Hive - that's the entire registry. Sometimes people refer to the top level keys.
  • Key - The top level consists of keys. Keys can contain values.
  • Subkey - Everything under the top level keys. Can contain values.
  • Value - an identifying name plus data. 'Value' refers to the entire name\data unit and sometimes to just the name.

Simplified Syntax

This is not meant to be a comprehensive explanation of how to use RegEdit, just a quick compendium of the stuff that I find most useful. RegEdit can do a lot more than what I'm going to talk about and, truth be told, if you really want to do some fancy registry manipulation in a script, go for WSH instead. Having said that, the syntax to run a script is dead simple.

RegEdit [/s] script.reg
  • The /s means 'don't bother me with message boxes, just run the script.' It is optional.
  • script.reg is a text file that contains the actual information to be imported into registry or trees or values to be deleted.

Adding A Value

A value needs to have a place to be located and its data needs a type. In the case of a string, the data type is specified because the string is in quotes. Quoted strings that have an embedded '\' in them must duplicate the '\' or bad things happen. Sooner or later, you'll forget that and it is going to cost you dearly.

[HKEY_CURRENT_USER\Software\Haggard And Associates\BuildComplete\Settings]
"Last Dir"="\\\\guinness\\software\\kits\\SOM\\som-dev"
"Logging"=dword:0000001f

Deleting A Value

To delete a value, specify a dash (-) for the value's data.

[HKEY_CURRENT_USER\Software\Haggard And Associates\BuildComplete\Settings]
"Last Dir"=-
"Logging"=-

Delete A Subkey

Deleting an entire sub key is easy. Just prepend a tilde (~) to the subkey name and away it goes along with everything it owns.

[~HKEY_CURRENT_USER\Software\Haggard And Associates\BuildComplete\Settings]

Back Up Next

Hit Counter