Mark Michaelis' Weblog :
Updated: 9/1/2004; 6:54:10 AM.

 








Subscribe to "Mark Michaelis' Weblog" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.

Subscribe To
Mark's Weblog

 
 

Friday, December 27, 2002

REG Command
Google Search It

For some time now I have been wondering if one could delete a registry entry via a reg file.  I often use these files to make configuration changes to the registry rather than manully opening up the registry and adding the files.  I still haven't found a reg file way of updating the registry but I have a better way.  There is a REG command that can do what I am looking for.  REG /? reveals the following syntax.

REG DELETE KeyName [/v ValueName | /ve | /va] [/f]

  KeyName    [\Machine]FullKey
    Machine  Name of remote machine - omitting defaults to the current machine
             Only HKLM and HKU are available on remote machines
    FullKey  ROOTKEYSubKey
    ROOTKEY  [ HKLM | HKCU | HKCR | HKU | HKCC ]
    SubKey   The full name of a registry key under the selected ROOTKEY
  ValueName  The value name, under the selected Key, to delete
             When omitted, all subkeys and values under the Key are deleted
  /ve        delete the value of empty value name <no name>
  /va        delete all values under this key
  /f         Forces the deletion without propmt

Examples:

  REG DELETE HKLMSoftwareMyCoMyAppTimeout
    Deletes the registry key Timeout and its all subkeys and values

  REG DELETE \ZODIACHKLMSoftwareMyCo /v MTU
    Deletes the registry value MTU under MyCo on ZODIAC

Note from the second example that you can use the reg command to modify settings on remote computers too (assuming you have appropriate security access.)


3:57:36 PM   []    comment []

© Copyright 2004 Mark Michaelis.



 


December 2002
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Nov   Jan


Recent Posts