Create empty registry value?

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,429
40
Albuquerque, NM
prospero.unm.edu
#1
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,229
11
Solon, OH, USA
#2
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....
>
>
 
#6
----- 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.