Create empty registry value?

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,426
85
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,489
15
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
11,297
95
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
Thread starter Title Forum Replies Date
Joe Caverly Create Windows Jobs and optionally attach processes to a job Support 17
E How to? Create a portable version of TCMD to use on other computers w/o installation Support 4
Alpengreis Fixed 0xc0000005 while try to create a button (Schaltfläche) Support 4
MickeyF create an alias with optional parameter Support 4
G How to? Trying to create TCC shortcut that opens with blue background (on Windows 8.1 x64) Support 1
noahcoad How to? Create shortcut with env var in path Support 4
S Problems to create new threads Support 6
C How to? create a JPSoft BTM menu to run custom custom batch files Support 2
A How to? Create a date range based upon creation date Support 2
S How to? Change thread prefix? Easy "create thread" method? Support 8
Stefano Piccardi Why did Windows create an encryption key? Support 5
S Create links or junctions on network drive Support 5
Jay Sage How Can SENDMAIL Create Messages with Plain Text and HTML Support 2
G create standalone .exe? Support 1
gentzel Directory stack empty when running TCEXIT? Support 9
Chen Touboul When i try to delete an empty folder i got "the dirctoy name is invalid" Support 3
M WAD "Pictures" directory is empty in TCC but not in CMD or Explorer Support 4
thorntonpg sync /S /F creating empty directories Support 5
T input accepts empty answer Support 5
D Directory stack empty Support 1
vefatica Empty .watch files saved Support 0
M Forums appear empty if I'm not logged in Support 2
A How to? Frozen session tab with "ERROR: The file is either empty or does not contain the valid choices." Support 19
C How to? List empty folders Support 21
L WAD File-popup Window nearly empty Support 6
T dir /h error in empty directory Support 22
C MOVE making empty destinatation sub-folders Support 10
D LIST command wierdness with empty Unicode file Support 1
vefatica DO variable left with empty value Support 0
rconn Installer leaves directory empty Support 7
CWBillow Ditching empty folders Support 11
Fross Deleting Registry DWord Value Support 2
vefatica Registry oddity Support 14
M Another possibly strange remote registry issue Support 5
C "Failed to update the system registry. Please try using REGEDIT" Support 3
C Windows Registry Support 7
cgunhouse Registry Issues Support 8
S How to? Monitor shutdown event and write registry value Support 2
fpefpe How to? Volatile Registry Support 6
C OT: Registry OPEN verb to start elevated... Support 2
C Registry keys? (not JP specific) Support 0
C not sure of windows registry function use Support 2
C Take Command 11 registry keys not removed Support 1
fpefpe Registry as file system Support 20
P Version of TCMD that does not use the registry for keys, etc Support 5
C Re: Registry Entries Support 1
C Registry Entries Support 1
C Registry entries Support 0
D Settings not writting to registry in XP (32 bit) Support 10

Similar threads