Create empty registry value?

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,689
106
Albuquerque, NM
prospero.unm.edu
Does anybody have a clever way to create an empty registry entry of type REG_SZ using 4NT/TCC? @REGSET deletes any matching entry if it's passed a blank value (as documented.) I thought it would be possible to pass a value of ``, but that creates a value with two backticks (why?) Variables or functions which evaluate to an empty string also delete the registry entry. A string consisting of all spaces, e.g. %@CHAR[32], also deletes the entry.

Of course I could call REGEDIT.EXE or REG.EXE, but that's inelegant....
 

samintz

Scott Mintz
May 20, 2008
1,555
26
Solon, OH, USA
Why is it inelegant? REG and RegEdit exist on all PC's since Win2K.

-Scott

Charles Dye <> wrote on 08/14/2008 11:14:33 AM:


> Does anybody have a clever way to create an empty registry entry of
> type REG_SZ using 4NT/TCC? @REGSET deletes any matching entry if
> it's passed a blank value (as documented.) I thought it would be
> possible to pass a value of ``, but that creates a value with two
> backticks (why?) Variables or functions which evaluate to an empty
> string also delete the registry entry. A string consisting of all
> spaces, e.g. %@CHAR[32], also deletes the entry.
>
> Of course I could call REGEDIT.EXE or REG.EXE, but that's inelegant....
>
>
 
May 20, 2008
12,167
133
Syracuse, NY, USA
On Thu, 14 Aug 2008 11:05:11 -0500, Rex Clark <> wrote:


>set Empty=%@regcreate[HKCU\Empty\]
>set Empty=%@regset[HKCU\Empty\Null,REG_SZ,%@char[160]]

That won't be empty; it'll have one character in it.
 
----- Original Message -----
From: "vefatica" <>
To: <rexxc@slingshot.co.nz>
Sent: Friday, August 15, 2008 4:29 AM
Subject: RE: [Support-t-393] Create empty registry value?


: On Thu, 14 Aug 2008 11:05:11 -0500, Rex Clark <> wrote:
:
:
:
: ---Quote---
: >set Empty=%@regcreate[HKCU\Empty\]
: >set Empty=%@regset[HKCU\Empty\Null,REG_SZ,%@char[160]]
: ---End Quote---
: That won't be empty; it'll have one character in it.
:
:
:

Visibly empty but with one character yes.
 

Similar threads

C
Replies
1
Views
2K
C
Replies
1
Views
2K