CreateKey returned 6
-
Hi, I know this is not the right forum but as i could not see vb forum i am posting here. I wrote small vbscript function to add registry key and value. here is the script.
strComputer = "."
Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
keyPath = "*\shellex\ContextMenuHandlers\WWBuildShell64Ext"
Return = oReg.CreateKey HKEY_CLASSES_ROOT ,keyPath
If (Return = 0) And (Err.Number = 0) ThenWscript.Echo "HKEY\_LOCAL\_MACHINE\\Software\\MyKey\\MySubKey created"
Else
Wscript.Echo "CreateKey failed. Error = " & Err.Number
End Ifit is returning 6. What does it mean? how to solve this? Regards,
-
Hi, I know this is not the right forum but as i could not see vb forum i am posting here. I wrote small vbscript function to add registry key and value. here is the script.
strComputer = "."
Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
keyPath = "*\shellex\ContextMenuHandlers\WWBuildShell64Ext"
Return = oReg.CreateKey HKEY_CLASSES_ROOT ,keyPath
If (Return = 0) And (Err.Number = 0) ThenWscript.Echo "HKEY\_LOCAL\_MACHINE\\Software\\MyKey\\MySubKey created"
Else
Wscript.Echo "CreateKey failed. Error = " & Err.Number
End Ifit is returning 6. What does it mean? how to solve this? Regards,
You can ask your question on the Visual Basic[^] but I think you need to check return value of CreateKey. :)
Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )