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

  

上一篇:[译]ZOOKEEPER RECIPES-TWO PHASED COMMIT


下一篇:Django中Admin样式定制