Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CreateKey returned 6

CreateKey returned 6

Scheduled Pinned Locked Moved C / C++ / MFC
windows-admintoolshelptutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    subramanyeswari
    wrote on last edited by
    #1

    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) Then

    Wscript.Echo "HKEY\_LOCAL\_MACHINE\\Software\\MyKey\\MySubKey created"
    

    Else
    Wscript.Echo "CreateKey failed. Error = " & Err.Number
    End If

    it is returning 6. What does it mean? how to solve this? Regards,

    H 1 Reply Last reply
    0
    • S subramanyeswari

      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) Then

      Wscript.Echo "HKEY\_LOCAL\_MACHINE\\Software\\MyKey\\MySubKey created"
      

      Else
      Wscript.Echo "CreateKey failed. Error = " & Err.Number
      End If

      it is returning 6. What does it mean? how to solve this? Regards,

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #2

      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 )

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups