PC Review


Reply
Thread Tools Rate Thread

Append to an Existing REG_SZ Value in Registry Using a .Reg File

 
 
=?Utf-8?B?Um9uIFNvY2hhbnNraQ==?=
Guest
Posts: n/a
 
      16th Apr 2007
Hello. How can a REG_SZ registry value be modified using a .reg file, so as
to append a string to the original data of the value? In other words, if a
Windows registry key [HKLM/.../ABCDE] has a REG_SZ value Value1 where
Value1's data is equal to "String1", then how can I modify Value1's data to
be "String1"+"String2" (i.e., "String1" concatenated with "String2") using a
..reg file, where Value1's data is not known? Thank you.
 
Reply With Quote
 
 
 
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      16th Apr 2007

"Ron Sochanski" <(E-Mail Removed)> wrote in message
news:61232D85-3056-4240-B8AD-(E-Mail Removed)...
> Hello. How can a REG_SZ registry value be modified using a .reg file, so

as
> to append a string to the original data of the value? In other words, if

a
> Windows registry key [HKLM/.../ABCDE] has a REG_SZ value Value1 where
> Value1's data is equal to "String1", then how can I modify Value1's data

to
> be "String1"+"String2" (i.e., "String1" concatenated with "String2") using

a
> .reg file, where Value1's data is not known? Thank you.


You have to extport the value, add your string to its data, then
import it into the registry.


 
Reply With Quote
 
=?Utf-8?B?Um9uIFNvY2hhbnNraQ==?=
Guest
Posts: n/a
 
      17th Apr 2007


"Pegasus (MVP)" wrote:

>
> "Ron Sochanski" <(E-Mail Removed)> wrote in message
> news:61232D85-3056-4240-B8AD-(E-Mail Removed)...
> > Hello. How can a REG_SZ registry value be modified using a .reg file, so

> as
> > to append a string to the original data of the value? In other words, if

> a
> > Windows registry key [HKLM/.../ABCDE] has a REG_SZ value Value1 where
> > Value1's data is equal to "String1", then how can I modify Value1's data

> to
> > be "String1"+"String2" (i.e., "String1" concatenated with "String2") using

> a
> > .reg file, where Value1's data is not known? Thank you.

>
> You have to extport the value, add your string to its data, then
> import it into the registry.
>
>
>

That would only work if the value's original data is identical on both
source and target machine. If the value's original data on the target
machine differs from that of the source machine in the distributed .reg file,
the value's original data on the target machine would essentially be lost.
What's needed here is dynamically determining a value's original data using a
..reg file. Can this be done? Thank you.
 
Reply With Quote
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      17th Apr 2007

"Ron Sochanski" <(E-Mail Removed)> wrote in message
news:2A7CA875-87BF-4A8A-A896-(E-Mail Removed)...
>
>
> "Pegasus (MVP)" wrote:
>
> >
> > "Ron Sochanski" <(E-Mail Removed)> wrote in

message
> > news:61232D85-3056-4240-B8AD-(E-Mail Removed)...
> > > Hello. How can a REG_SZ registry value be modified using a .reg file,

so
> > as
> > > to append a string to the original data of the value? In other words,

if
> > a
> > > Windows registry key [HKLM/.../ABCDE] has a REG_SZ value Value1 where
> > > Value1's data is equal to "String1", then how can I modify Value1's

data
> > to
> > > be "String1"+"String2" (i.e., "String1" concatenated with "String2")

using
> > a
> > > .reg file, where Value1's data is not known? Thank you.

> >
> > You have to extport the value, add your string to its data, then
> > import it into the registry.
> >
> >
> >

> That would only work if the value's original data is identical on both
> source and target machine. If the value's original data on the target
> machine differs from that of the source machine in the distributed .reg

file,
> the value's original data on the target machine would essentially be lost.
> What's needed here is dynamically determining a value's original data

using a
> .reg file. Can this be done? Thank you.


If you run the process I described on the target machine
then it will work because it will extract the existing data
on that machine, no matter what it is.


 
Reply With Quote
 
=?Utf-8?B?Um9uIFNvY2hhbnNraQ==?=
Guest
Posts: n/a
 
      17th Apr 2007


"Pegasus (MVP)" wrote:

>
> "Ron Sochanski" <(E-Mail Removed)> wrote in message
> news:2A7CA875-87BF-4A8A-A896-(E-Mail Removed)...
> >
> >
> > "Pegasus (MVP)" wrote:
> >
> > >
> > > "Ron Sochanski" <(E-Mail Removed)> wrote in

> message
> > > news:61232D85-3056-4240-B8AD-(E-Mail Removed)...
> > > > Hello. How can a REG_SZ registry value be modified using a .reg file,

> so
> > > as
> > > > to append a string to the original data of the value? In other words,

> if
> > > a
> > > > Windows registry key [HKLM/.../ABCDE] has a REG_SZ value Value1 where
> > > > Value1's data is equal to "String1", then how can I modify Value1's

> data
> > > to
> > > > be "String1"+"String2" (i.e., "String1" concatenated with "String2")

> using
> > > a
> > > > .reg file, where Value1's data is not known? Thank you.
> > >
> > > You have to extport the value, add your string to its data, then
> > > import it into the registry.
> > >
> > >
> > >

> > That would only work if the value's original data is identical on both
> > source and target machine. If the value's original data on the target
> > machine differs from that of the source machine in the distributed .reg

> file,
> > the value's original data on the target machine would essentially be lost.
> > What's needed here is dynamically determining a value's original data

> using a
> > .reg file. Can this be done? Thank you.

>
> If you run the process I described on the target machine
> then it will work because it will extract the existing data
> on that machine, no matter what it is.
>
>
>

The process you described involved exporting from the registry and then
subsequently importing into the registry. The only way I know of to export
is to do so manually, i.e., via manually running regedit and then exporting.
On the target machine, therefore, I'd need to manually export, manually edit
the .reg file that was created and then apply the .reg file. I desire to
have a .reg file that has already been created which I could copy to the
target machine and simply run. I don't want to export manually on the target
machine. If there is an automated method to accomplish this, then please
advise.
 
Reply With Quote
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      17th Apr 2007

"Ron Sochanski" <(E-Mail Removed)> wrote in message
news:869F5809-9D7F-4114-9811-(E-Mail Removed)...
>
>
> "Pegasus (MVP)" wrote:
>
> >
> > "Ron Sochanski" <(E-Mail Removed)> wrote in

message
> > news:2A7CA875-87BF-4A8A-A896-(E-Mail Removed)...
> > >
> > >
> > > "Pegasus (MVP)" wrote:
> > >
> > > >
> > > > "Ron Sochanski" <(E-Mail Removed)> wrote in

> > message
> > > > news:61232D85-3056-4240-B8AD-(E-Mail Removed)...
> > > > > Hello. How can a REG_SZ registry value be modified using a .reg

file,
> > so
> > > > as
> > > > > to append a string to the original data of the value? In other

words,
> > if
> > > > a
> > > > > Windows registry key [HKLM/.../ABCDE] has a REG_SZ value Value1

where
> > > > > Value1's data is equal to "String1", then how can I modify

Value1's
> > data
> > > > to
> > > > > be "String1"+"String2" (i.e., "String1" concatenated with

"String2")
> > using
> > > > a
> > > > > .reg file, where Value1's data is not known? Thank you.
> > > >
> > > > You have to extport the value, add your string to its data, then
> > > > import it into the registry.
> > > >
> > > >
> > > >
> > > That would only work if the value's original data is identical on both
> > > source and target machine. If the value's original data on the target
> > > machine differs from that of the source machine in the distributed

..reg
> > file,
> > > the value's original data on the target machine would essentially be

lost.
> > > What's needed here is dynamically determining a value's original data

> > using a
> > > .reg file. Can this be done? Thank you.

> >
> > If you run the process I described on the target machine
> > then it will work because it will extract the existing data
> > on that machine, no matter what it is.
> >
> >
> >

> The process you described involved exporting from the registry and then
> subsequently importing into the registry. The only way I know of to

export
> is to do so manually, i.e., via manually running regedit and then

exporting.
> On the target machine, therefore, I'd need to manually export, manually

edit
> the .reg file that was created and then apply the .reg file. I desire to
> have a .reg file that has already been created which I could copy to the
> target machine and simply run. I don't want to export manually on the

target
> machine. If there is an automated method to accomplish this, then please
> advise.


Here is an example:

regedit /e c:\test.reg HKEY_LOCAL_MACHINE\SOFTWARE\ORL\WinVNC3\Default


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Registry SetValue stores double as REG_SZ ChuckD_Duncan Microsoft Dot NET 1 31st Jul 2005 06:31 AM
Getting registry value's data type (REG_SZ/REG_EXPAND_SZ) Asaf Ganot Microsoft C# .NET 1 18th Jun 2005 12:25 AM
edit "reg_sz" string in registry with a .reg file Jason Microsoft Windows 2000 Registry 2 4th Nov 2003 03:06 PM
edit "reg_sz" string in registry with a .reg file Jason Microsoft Windows 2000 Registry Archive 4 4th Nov 2003 03:06 PM
edit "reg_sz" string in registry with a .reg file Jason Microsoft Windows 2000 Registry Archive 0 3rd Nov 2003 07:00 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:53 PM.