1
我已經完成了這段代碼,但它似乎並不奏效。我不知道爲什麼。我在谷歌搜索,但沒有運氣。 :(試圖在註冊表數據庫中創建一個密鑰
Set objREG = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
Const HKEY_LOCAL_MACHINE = &H80000002
Dim lstrKeyPath, lstrValueName, lstrValue
lstrKeyPath = "SOFTWARE\Canon\GARO1\"
lstrValueName = "LocaleInfo"
objReg.GetStringValue HKEY_LOCAL_MACHINE,lstrKeyPath,lstrValueName,lstrValue
msgbox lstrValue <--- This works.
if IsNull(lstrValue) then
lstrKeyPath = lstrKeyPath & lstrValueName
else
lstrValueName = "LocaleTest"
lstrKeyPath = "Software\Test\"
Return = objReg.CreateKey(HKEY_LOCAL_MACHINE,lstrKeyPath)
if Return = 0 Then
msgbox "Yes"
else
msgbox "No"
end if
end if
Set OBJREG = Nothing
我看不到我的「測試」鍵