Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Create empty registry value?

Charles Dye

Super Moderator
May
4,948
126
Staff member
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....
 
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....
>
>
 
----- Original Message -----
Subject: [Support-t-393] Create empty registry value?

set Empty=%@regcreate[HKCU\Empty\]
set Empty=%@regset[HKCU\Empty\Null,REG_SZ,%@char[160]]
 
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: <[email protected]>
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

Back
Top