"James Whitlow" wrote:
Quote:
> "Vilius Mockûnas" <v_mockunas@xxxxxx> wrote in message
> news:e35YS6l6JHA.1372@xxxxxx Quote:
> > Hello,
> >
> > 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 ?
>
> As an alternative to 'RegWrite', you could use the WMI registry object.
>
> Const HKCU = &H80000001
> Set oReg = GetObject("WinMgmts:\root\default:StdRegProv")
> oReg.CreateKey HKCU, "Software\somekey"
>
> Or, also as an alternative to 'RegWrite':
obj1.run "reg add ""HKCU\Software\somekey""", 0,true