Registry Add Commands

G

Guest

Guest
Archived from groups: microsoft.public.win2000.general (More info?)

I'v need to add some registry key, but forgot how to do the REG4 commands.
Can somebody remind me how to add keys thru the REG4 or other REG add thru
command line statements.

Terry
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.general (More info?)

You can use Regedit.exe along with a .reg file to add any entry in the
registry e.g.

REGEDIT /S addsome.REG


OR

You can use Regwrite function with WScript.
RegWrite ( "keyname" [,"valuename", "type", value] )
Parameters

keyname The registry key to write to. If no other parameters are
specified this key will simply be created.
valuename [optional] The valuename to write to.
type [optional] Type of key to write: "REG_SZ", "REG_MULTI_SZ",
"REG_EXPAND_SZ", "REG_DWORD", or "REG_BINARY".
value [optional] The value to write.


--
Thanks,
Puja
---------------------------------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.

"Terry Swift" <TerrySwift@discussions.microsoft.com> wrote in message
news:67001802-ABF1-409D-B4F7-D0A7ADE1CF72@microsoft.com...
> I'v need to add some registry key, but forgot how to do the REG4 commands.
> Can somebody remind me how to add keys thru the REG4 or other REG add thru
> command line statements.
>
> Terry
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.general (More info?)

Here are the two keys that the Tech wants to be installed. I put them into
the .reg file, but they wouldn't load.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BITS\Parameters /v
ServiceDll /t REG_EXPAND_SZ /d %windir%\System32\qmgr.dll

HKey_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\BackupRestore\FilesNotToBackup

Are there are commands that I need to put in from of the keys to get them to
load?

Terry

"Puja Pandey[MSFT]" wrote:

> You can use Regedit.exe along with a .reg file to add any entry in the
> registry e.g.
>
> REGEDIT /S addsome.REG
>
>
> OR
>
> You can use Regwrite function with WScript.
> RegWrite ( "keyname" [,"valuename", "type", value] )
> Parameters
>
> keyname The registry key to write to. If no other parameters are
> specified this key will simply be created.
> valuename [optional] The valuename to write to.
> type [optional] Type of key to write: "REG_SZ", "REG_MULTI_SZ",
> "REG_EXPAND_SZ", "REG_DWORD", or "REG_BINARY".
> value [optional] The value to write.
>
>
> --
> Thanks,
> Puja
> ---------------------------------------------------------
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Terry Swift" <TerrySwift@discussions.microsoft.com> wrote in message
> news:67001802-ABF1-409D-B4F7-D0A7ADE1CF72@microsoft.com...
> > I'v need to add some registry key, but forgot how to do the REG4 commands.
> > Can somebody remind me how to add keys thru the REG4 or other REG add thru
> > command line statements.
> >
> > Terry
>
>
>
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.general (More info?)

"=?Utf-8?B?VGVycnkgU3dpZnQ=?="
<TerrySwift@discussions.microsoft.com> wrote in
news:9667F968-BE80-4767-8C16-BAE4F94919D1@microsoft.com:

> Here are the two keys that the Tech wants to be installed. I put
> them into the .reg file, but they wouldn't load.
>
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BITS\Parameter
> s /v ServiceDll /t REG_EXPAND_SZ /d %windir%\System32\qmgr.dll
>
> HKey_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\BackupRestore\F
> ilesNotToBackup
>
> Are there are commands that I need to put in from of the keys to
> get them to load?
>
> Terry
>

Assuming you are using reg.exe version 2.0 or newer, simply put
reg add
in front of your commands at a command prompt. For help, type
"reg add /?".
So your first example would be:
reg add HKLM\SYSTEM\CurrentControlSet\Services\BITS\Parameters /v ServiceDll /t REG_EXPAND_SZ /d %windir%\System32\qmgr.dll

This is not the correct format for a ".reg" file.

HTH,
John
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.general (More info?)

John,

When I'm in the "cmd" prompt and doing the "reg add /?" without the quotes
of course, it gives me the 'reg' is not recognized as an internal or external
command, operable program or batch file. I've never heard of reg.exe version
2.0 or newer - where does that come from? I have SP4 and the highest update
after that, so I would assume that my files would be updated to the latest
and greatest.

Terry

"John Wunderlich" wrote:

> "=?Utf-8?B?VGVycnkgU3dpZnQ=?="
> <TerrySwift@discussions.microsoft.com> wrote in
> news:9667F968-BE80-4767-8C16-BAE4F94919D1@microsoft.com:
>
> > Here are the two keys that the Tech wants to be installed. I put
> > them into the .reg file, but they wouldn't load.
> >
> > HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BITS\Parameter
> > s /v ServiceDll /t REG_EXPAND_SZ /d %windir%\System32\qmgr.dll
> >
> > HKey_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\BackupRestore\F
> > ilesNotToBackup
> >
> > Are there are commands that I need to put in from of the keys to
> > get them to load?
> >
> > Terry
> >
>
> Assuming you are using reg.exe version 2.0 or newer, simply put
> reg add
> in front of your commands at a command prompt. For help, type
> "reg add /?".
> So your first example would be:
> reg add HKLM\SYSTEM\CurrentControlSet\Services\BITS\Parameters /v ServiceDll /t REG_EXPAND_SZ /d %windir%\System32\qmgr.dll
>
> This is not the correct format for a ".reg" file.
>
> HTH,
> John
>
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.general (More info?)

You shd be getting the following output.

C:\>reg add /?

Console Registry Tool for Windows - version 3.0
Copyright (C) Microsoft Corp. 1981-2001. All rights reserved


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

--
Thanks,
Puja
---------------------------------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
"Terry Swift" <TerrySwift@discussions.microsoft.com> wrote in message
news:D0253ED7-CB76-4D24-9BB8-9A952384D5A2@microsoft.com...
> John,
>
> When I'm in the "cmd" prompt and doing the "reg add /?" without the quotes
> of course, it gives me the 'reg' is not recognized as an internal or
> external
> command, operable program or batch file. I've never heard of reg.exe
> version
> 2.0 or newer - where does that come from? I have SP4 and the highest
> update
> after that, so I would assume that my files would be updated to the latest
> and greatest.
>
> Terry
>
> "John Wunderlich" wrote:
>
>> "=?Utf-8?B?VGVycnkgU3dpZnQ=?="
>> <TerrySwift@discussions.microsoft.com> wrote in
>> news:9667F968-BE80-4767-8C16-BAE4F94919D1@microsoft.com:
>>
>> > Here are the two keys that the Tech wants to be installed. I put
>> > them into the .reg file, but they wouldn't load.
>> >
>> > HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BITS\Parameter
>> > s /v ServiceDll /t REG_EXPAND_SZ /d %windir%\System32\qmgr.dll
>> >
>> > HKey_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\BackupRestore\F
>> > ilesNotToBackup
>> >
>> > Are there are commands that I need to put in from of the keys to
>> > get them to load?
>> >
>> > Terry
>> >
>>
>> Assuming you are using reg.exe version 2.0 or newer, simply put
>> reg add
>> in front of your commands at a command prompt. For help, type
>> "reg add /?".
>> So your first example would be:
>> reg add HKLM\SYSTEM\CurrentControlSet\Services\BITS\Parameters /v
>> ServiceDll /t REG_EXPAND_SZ /d %windir%\System32\qmgr.dll
>>
>> This is not the correct format for a ".reg" file.
>>
>> HTH,
>> John
>>
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.general (More info?)

Puja,

Wouldn't you only get that if you added the reg.exe file from the W2K
Resource Kit? Otherwise you wouldn't have that loaded ,as I don't have it.
I can load registry files using a .reg file, otherwise known as a Reg4 file
which works pretty much the same way.

Terry

"Puja Pandey[MSFT]" wrote:

> You shd be getting the following output.
>
> C:\>reg add /?
>
> Console Registry Tool for Windows - version 3.0
> Copyright (C) Microsoft Corp. 1981-2001. All rights reserved
>
>
> 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
>
> --
> Thanks,
> Puja
> ---------------------------------------------------------
> This posting is provided "AS IS" with no warranties, and confers no rights.
> "Terry Swift" <TerrySwift@discussions.microsoft.com> wrote in message
> news:D0253ED7-CB76-4D24-9BB8-9A952384D5A2@microsoft.com...
> > John,
> >
> > When I'm in the "cmd" prompt and doing the "reg add /?" without the quotes
> > of course, it gives me the 'reg' is not recognized as an internal or
> > external
> > command, operable program or batch file. I've never heard of reg.exe
> > version
> > 2.0 or newer - where does that come from? I have SP4 and the highest
> > update
> > after that, so I would assume that my files would be updated to the latest
> > and greatest.
> >
> > Terry
> >
> > "John Wunderlich" wrote:
> >
> >> "=?Utf-8?B?VGVycnkgU3dpZnQ=?="
> >> <TerrySwift@discussions.microsoft.com> wrote in
> >> news:9667F968-BE80-4767-8C16-BAE4F94919D1@microsoft.com:
> >>
> >> > Here are the two keys that the Tech wants to be installed. I put
> >> > them into the .reg file, but they wouldn't load.
> >> >
> >> > HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BITS\Parameter
> >> > s /v ServiceDll /t REG_EXPAND_SZ /d %windir%\System32\qmgr.dll
> >> >
> >> > HKey_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\BackupRestore\F
> >> > ilesNotToBackup
> >> >
> >> > Are there are commands that I need to put in from of the keys to
> >> > get them to load?
> >> >
> >> > Terry
> >> >
> >>
> >> Assuming you are using reg.exe version 2.0 or newer, simply put
> >> reg add
> >> in front of your commands at a command prompt. For help, type
> >> "reg add /?".
> >> So your first example would be:
> >> reg add HKLM\SYSTEM\CurrentControlSet\Services\BITS\Parameters /v
> >> ServiceDll /t REG_EXPAND_SZ /d %windir%\System32\qmgr.dll
> >>
> >> This is not the correct format for a ".reg" file.
> >>
> >> HTH,
> >> John
> >>
>
>
>
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.general (More info?)

Terry Swift wrote:

> Puja,
>
> Wouldn't you only get that if you added the reg.exe file
> from the W2K Resource Kit? Otherwise you wouldn't have
> that loaded ,as I don't have it.

Latest Win2k version of reg.exe is available in this package:
http://www.microsoft.com/windows2000/downloads/servicepacks/sp4/supporttools.asp
You could put this reg.exe file on a share on your server, or copy
the file to each Win2k computer.

> I can load registry files using a .reg file, otherwise known
> as a Reg4 file which works pretty much the same way.

To set your registry values with a registry file (.reg), use
regedit.exe to export the 2 keys to separate registry files. Then use
e.g. Notepad to merge those two files into one registry file (you
should remove any extra registry values that happened to be exported).


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx