Click here to Skip to main content
15,903,831 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I was searching on Internet with this topic but dont have much luck, so i am trying my luck in here now, lol

My scenario is: i am havning a centralise release server that hosts the release applicaiton and backups, and now i would like to extend this application to allow the user to import the .reg file, sits on the release server, to a remote machine.

just as an example, in windows, if we open registry edit, and we have an option "Connect Network Registry", so we can connec to remote machine, and once we connected, we can select the .reg file from local mahcine and import into the remote machine. Our release application would like to achieve the same goal.

Hopefully i describe the scenario cleary, and since Windows is able to do it, then i am sure there is a way to do it in .Net, can someone in here point me to the right direction.

Thanks heaps.

Reply·Email·View Thread
Posted
Comments
Jackie00100 30-Nov-11 22:14pm    
not sure i understand this rigth but is it adding/editing keys and values in regedit you wanna do?

1 solution

Resource Kit to add this tool. You can download REG.EXE from here: Download Free Windows 2000 Resource Kit Tools

You can use REG.EXE by giving it a command from a short list of options (query, add, update, delete, copy, save, backup, restore, load, and unload), followed by one or more optional parameters that the command you specify will interpret.
Querying keys

REG query allows you to query a single key for a single value, or a range of keys for all their values. This provides you with a quick way to check whether a key has the value you think it does, or in fact whether it has any values associated with it at all:

REG QUERY KeyName [/v ValueName | /ve] [/s]

KeyName [\\Machine\]FullKey

Machine - Name of remote machine, omitting defaults to the current machine (Note: the REG.EXE help syntax is wrong. You should use \\ and NOT \ as written!)

Only HKLM and HKU are available on remote machines

FullKey - in the form of ROOTKEY\SubKey name

ROOTKEY [ HKLM | HKCU | HKCR | HKU | HKCC ]

SubKey - The full name of a registry key under the selected ROOTKEY

/v query for a specific registry key

ValueName - The name, under the selected Key, to query

if omitted, all values under the Key are queried

/ve query for the default value or empty value name <no name>

/s queries all subkeys and values

Example:

C:\WINDOWS>reg query \\srv1\hklm\software\symantec ! REG.EXE VERSION 3.0
HKEY_LOCAL_MACHINE\software\symantec
HKEY_LOCAL_MACHINE\software\symantec\InstalledApps
HKEY_LOCAL_MACHINE\softwaresymantec\LiveUpdate
HKEY_LOCAL_MACHINE\software\symantec\NAVMSE
HKEY_LOCAL_MACHINE\software\symantec\Norton AntiVirus
HKEY_LOCAL_MACHINE\software\symantec\Norton AntiVirus NT
HKEY_LOCAL_MACHINE\software\symantec\Shared Technology
HKEY_LOCAL_MACHINE\software\symantec\SharedDefs
HKEY_LOCAL_MACHINE\software\symantec\SharedUsage
HKEY_LOCAL_MACHINE\software\symantec\Symevent

Adding new keys

REG.EXE add adds new keys and values to the Registry. You can add a value to an existing key, add a new key with no values, or create a new key and a value beneath it. If you try to add a key or value that already exists, REG.EXE will warn you.

REG ADD KeyName [/v ValueName | /ve] [/t Type] [/s Separator] [/d Data] [/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 ROOTKEY\SubKey

ROOTKEY [ HKLM | HKCU | HKCR | HKU | HKCC ]

SubKey The full name of a registry key under the selected ROOTKEY

/v The value name, under the selected Key, to add

/ve adds an empty value name <no name> for the key

/t RegKey data types:

[ REG_SZ, REG_MULTI_SZ, REG_DWORD_BIG_ENDIAN, REG_DWORD, REG_BINARY, REG_DWORD_LITTLE_ENDIAN, REG_NONE, REG_EXPAND_SZ ] If omitted, REG_SZ is assumed

/s Specify one charactor that you use as the separator in your data string for REG_MULTI_SZ. If omitted, use "\0" as the separator

/d The data to assign to the registry ValueName being added

/f Force overwriting the existing registry entry without prompt

Examples:

REG ADD \\ABC\HKLM\Software\MyCo Adds a key HKLM\Software\MyCo on remote machine ABC

REG ADD HKLM\Software\MyCo /v Data /t REG_BINARY /d fe340ead Adds a value (name: Data, type: REG_BINARY, data: fe340ead)

REG ADD HKLM\Software\MyCo /v MRU /t REG_MULTI_SZ /d fax\0mail Adds a value (name: MRU, type: REG_MUTLI_SZ, data: fax\0mail\0\0)

REG ADD HKLM\Software\MyCo /v Path /t REG_EXPAND_SZ /d %%systemroot%% Adds a value (name: Path, type: REG_EXPAND_SZ, data: %systemroot%) Notice: Use the double percentage ( %% ) inside the expand string

Removing a key

REG delete removes a key or value. When removing a key, it will remove all subkeys and values beneath that key; however, it will ask you to confirm your intentions before it actually deletes anything. As with REG update, you can only delete keys where the ACLs (and/or the remote Registry settings) allow you access.
 
Share this answer
 
Comments
RaviRanjanKr 1-Dec-11 14:55pm    
5+

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900