VBScript - CUD registry key and value

http://msdn.microsoft.com/en-us/library/aa384906(v=vs.85).aspx

 

HKEY_LOCAL_MACHINE = &H80000002

strComputer = "."



Set ObjRegistry = _

    GetObject("winmgmts:{impersonationLevel = impersonate}!\\" _

    & strComputer & "\root\default:StdRegProv")



strPath = "SOFTWARE\MyKey\MySubKey"



Return = objRegistry.CreateKey(HKEY_LOCAL_MACHINE, strPath)



If Return <> 0 Then

    WScript.Echo "The operation failed." & Err.Number

    WScript.Quit

Else

    wScript.Echo "New registry key created" & VBCRLF _

        & "HKLM\SOFTWARE\MYKey\"



End If

  

你可能感兴趣的:(VBScript)