RegWrite vbscript function is a bit tricky to me. For example I want to
create registry key:
dim obj1
set obj1 = CreateObject( "WScript.Shell" )
obj1.RegWrite( "HKCU\Software\somekey\", 1, "REG_SZ" )
So OK example above creates somekey key with default value 1, but my goal
here is to set default value to empty value, not 1. (emty value is displayed
like "(value not set)" in regedit).
How do I set default key value to emty value using RegWrite ?
thanks
Vilius
The only workaround I know is to write a key one level lower than the
desired level and delete it, something like this ...
sKey = "HKCU\SOFTWARE\somekey\dummy\"
with CreateObject("WScript.Shell")
.RegWrite sKey, Empty
.RegDelete sKey
end with
wsh.echo "Done"
I suppose there might be a way using the WMI registry class, but it's
bound to be more complicated than this little trick.
Tom Lavedas
***********
"Vilius Mock�nas" <v_moc...@yahoo.com> wrote in message
news:%23k7cdPn...@TK2MSFTNGP02.phx.gbl...