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

Create empty registry value?

Discussion in 'Support' started by Charles Dye, Aug 14, 2008.

  1. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,277
    Likes Received:
    38
    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....
     
  2. samintz

    samintz Scott Mintz

    Joined:
    May 20, 2008
    Messages:
    1,177
    Likes Received:
    11
    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:


     
  3. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,277
    Likes Received:
    38
    Oh, mostly just because I prefer to use internals wherever possible.
     
  4. Rex Clark

    Joined:
    May 30, 2008
    Messages:
    57
    Likes Received:
    0
    ----- 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]]
     
  5. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,784
    Likes Received:
    29
    On Thu, 14 Aug 2008 11:05:11 -0500, Rex Clark <> wrote:


    That won't be empty; it'll have one character in it.
     
  6. Rex Clark

    Joined:
    May 30, 2008
    Messages:
    57
    Likes Received:
    0
    ----- 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.
     

Share This Page