A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows XP » General XP issues or comments
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Registry: How ro create a REG_EXPAND_SZ default(!) string ?



 
 
Thread Tools Display Modes
  #1  
Old December 2nd 18, 03:35 PM posted to microsoft.public.windowsxp.general
R.Wieser
external usenet poster
 
Posts: 1,302
Default Registry: How ro create a REG_EXPAND_SZ default(!) string ?

Hello all,

Sometimes I use regedit to create new keys. Those keys always come with a
"(default)" string of the type REG_SZ. How can I change these strings, in
regedit, into a REG_EXPAND_SZ one (as is often needed with an HKCR -
{app} - "shell" - "open" - "command" entry) ?

Remark: For a non-default string I resorted to copying the data into the
clipboard, delete the key, recreate it as another type and paste the data
into it again, but that does not work for the default string.

I do have a work-around by which I create a temporary REG_EXPAND_SZ entry,
fill it with data, export it, rename the string in the REG file, import it
again and than remove the temporary entry - which I would really like to get
rid of.

Regards,
Rudy Wieser


Ads
  #2  
Old December 2nd 18, 11:28 PM posted to microsoft.public.windowsxp.general
JJ[_11_]
external usenet poster
 
Posts: 744
Default Registry: How ro create a REG_EXPAND_SZ default(!) string ?

On Sun, 2 Dec 2018 15:35:14 +0100, R.Wieser wrote:
Hello all,

Sometimes I use regedit to create new keys. Those keys always come with a
"(default)" string of the type REG_SZ. How can I change these strings, in
regedit, into a REG_EXPAND_SZ one (as is often needed with an HKCR -
{app} - "shell" - "open" - "command" entry) ?

Remark: For a non-default string I resorted to copying the data into the
clipboard, delete the key, recreate it as another type and paste the data
into it again, but that does not work for the default string.


It's not possible, unfortunately. The reason is that RegEdit doesn't have
the capability to change the type of a value. And it doesn't allow renaming
a named value to an unnamed / empty one - which turns it into the default
value.

I do have a work-around by which I create a temporary REG_EXPAND_SZ entry,
fill it with data, export it, rename the string in the REG file, import it
again and than remove the temporary entry - which I would really like to get
rid of.


That's the only workaround that can be applied on every Windows
installations.

I've had this problem years ago, and I've search for a third party registry
editors which have the ability to change value type. Surprisingly, I only
found 3 of them.

Advanced Registry Editor [freeware]
https://sourceforge.net/projects/regedt33/

Registry Commander [freeware]
http://www.aezay.dk/aezay/regcmd/

Regmagik [shareware]
http://www.regmagik.com/

But sadly, regedt33 and Registry Commander do not support Unicode. And
Registry Commander doesn't have an UI for the registry tree.
  #3  
Old December 2nd 18, 11:30 PM posted to microsoft.public.windowsxp.general
JJ[_11_]
external usenet poster
 
Posts: 744
Default Registry: How ro create a REG_EXPAND_SZ default(!) string ?

On Mon, 3 Dec 2018 05:28:15 +0700, JJ wrote:

Regmagik [shareware]
http://www.regmagik.com/


Oops. It's shareware for the 64-bit version. The 32-bit version is freeware.
  #4  
Old December 3rd 18, 09:22 AM posted to microsoft.public.windowsxp.general
R.Wieser
external usenet poster
 
Posts: 1,302
Default Registry: How ro create a REG_EXPAND_SZ default(!) string ?

JJ,

It's not possible, unfortunately. The reason is that RegEdit
doesn't have the capability to change the type of a value


I noticed that, and have been using the route thru the clipboard for a while
now. The whole problem is that you can't delete-and-recreate the
"(default)" key (it gets recreated as soon as you've deleted it). Hence,
you cannot "change" it from within regedit.

.... Though I was hoping I just missed something somewhere.

I've search for a third party registry editors which have the
ability to change value type. Surprisingly, I only found 3 of them.
[Snip]


Thanks.

Some time back I tried to write my own mini registry editor, but bumped into
the problem that such a program does not even have enough user rights to
*read* all the keys (let alone write) - which regedit had no problem with.

Regards,
Rudy Wieser


  #5  
Old December 3rd 18, 09:57 AM posted to microsoft.public.windowsxp.general
R.Wieser
external usenet poster
 
Posts: 1,302
Default Registry: How ro create a REG_EXPAND_SZ default(!) string ?

JJ,

I've search for a third party registry editors which have the
ability to change value type. Surprisingly, I only found 3 of them.


Grumble ...

"changing" the type of the "(default)" key (or any other I presume) seems to
be surprisingly easy using a bit of vbscript: It doesn't even complain when
overwriting the keys contents with a different type (in other words, no
"delete" step needed).

If I want to go fancy I could throw an input box at it (for the "copy key
name" result), another for the data-field name (which *ofcourse* doesn't get
included in the above), and than do the read/change type/write cycle
automatically.

Heck, I could even make a full-blown HTA from it. :-)

Regards,
Rudy Wieser


  #6  
Old December 3rd 18, 08:35 PM posted to microsoft.public.windowsxp.general
JJ[_11_]
external usenet poster
 
Posts: 744
Default Registry: How ro create a REG_EXPAND_SZ default(!) string ?

On Mon, 3 Dec 2018 09:57:22 +0100, R.Wieser wrote:

"changing" the type of the "(default)" key (or any other I presume) seems to
be surprisingly easy using a bit of vbscript: It doesn't even complain when
overwriting the keys contents with a different type (in other words, no
"delete" step needed).


Well, that's because WinAPI's RegSetValue() / RegSetValueEx() allow
overwriting values with different type. We should be glad that WSH doesn't
put restriction on that.

If I want to go fancy I could throw an input box at it (for the "copy key
name" result), another for the data-field name (which *ofcourse* doesn't get
included in the above), and than do the read/change type/write cycle
automatically.

Heck, I could even make a full-blown HTA from it. :-)


Please do. I'd be happy to check it.
  #7  
Old December 4th 18, 08:48 AM posted to microsoft.public.windowsxp.general
R.Wieser
external usenet poster
 
Posts: 1,302
Default Registry: How ro create a REG_EXPAND_SZ default(!) string ?

JJ,

Well, that's because WinAPI's RegSetValue() / RegSetValueEx()
allow overwriting values with different type.


Yup. Too bad that they (whomever "they" are) forgot to incoorporate that
into regedit (forcing clumsy work arounds). They should maybe have called
it regwrite, instead of -edit.

Heck, I could even make a full-blown HTA from it. :-)


Please do. I'd be happy to check it.


I need to be carefull when doing that, its too tempting to try to "go big"
and recreate a full webbified regedit in it (I already feel that urge).
It needs to keep to the point, and small.

Regards,
Rudy Wieser

"JJ" wrote in message
...
On Mon, 3 Dec 2018 09:57:22 +0100, R.Wieser wrote:

"changing" the type of the "(default)" key (or any other I presume) seems
to
be surprisingly easy using a bit of vbscript: It doesn't even complain
when
overwriting the keys contents with a different type (in other words, no
"delete" step needed).


Well, that's because WinAPI's RegSetValue() / RegSetValueEx() allow
overwriting values with different type. We should be glad that WSH doesn't
put restriction on that.

If I want to go fancy I could throw an input box at it (for the "copy key
name" result), another for the data-field name (which *ofcourse* doesn't
get
included in the above), and than do the read/change type/write cycle
automatically.

Heck, I could even make a full-blown HTA from it. :-)


Please do. I'd be happy to check it.



 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off






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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.