For Each ObjProcessor In ColSettings
If (ObjProcessor.AddressWidth = 64) Then
If FSO.FileExists("C:\Program Files (x86)\A\A Client\B\SelfService.exe") Then
strkey1 = WshShell.RegRead("HKLM\SOFTWARE\Wow6432Node\A\B\C\STORE0")
If (strkey1 = "AppGateway;https://A.net/C/B/Discovery;On;AppGateway") Then
Set objRegistry = GetObject("winmgmts:\\" & strComputer &"\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Wow6432Node\A\B\C\"
strValueName = "STORE0"
objRegistry.DeleteValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName
Call MsgBox("Test: " & strKeyPath)
End If
End If
End If
Next
因此,只有MsgBox函数正在工作,objRegistry.DeleteValue不是。我之前已经宣布过objRegistry。似乎无法找出原因
答案 0 :(得分:3)
登录用户应具有注册表项的权限。 根据@Farhan评论,他了解原因。提出答案,因为这将有助于其他有类似问题的人。