Trying to write to REG_MULTI_SZ ( ClosedRuiFileList )

In RhinoScript I am having trouble writing to a REG_MULTI_SZ ( ClosedRuiFileList )

I have followed the example from here:

Dim strKeyPath,MultValueName,strComputer,oReg,iValues
Const HKEY_LOCAL_MACHINE = &H80000002
strKeyPath = "SOFTWARE\McNeel\Rhinoceros\5.0x64\Scheme: Default\Window Positions\Docking Toolbars"
MultValueName = "ClosedRuiFileList"
iValues = Array(“string1”, “string2”)
strComputer = "."
Set oReg = GetObject(“winmgmts:{impersonationLevel=impersonate}!\” & strComputer & “\root\default:StdRegProv”)
oReg.CreateKey HKEY_LOCAL_MACHINE, strKeyPath
oReg.SetMultiStringValue HKEY_LOCAL_MACHINE, strKeyPath, MultValueName, iValues

Any help much appreciated,

1 Like

To write to the above hive, you will need to be running Rhino with elevated privledges…

Thanks Dale,

That was it - changed to HKEY_CURRENT_USER and all works now.