VBS的新手,基本上在符合标准的情况下,脚本将编辑注册表,这是我到目前为止所得到的。
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。似乎找不到原因
发布于 2016-09-23 13:08:41
已登录的用户应具有访问注册表项的权限。根据@Farhan的评论,他知道了原因。输入答案可以帮助其他有类似问题的人。
https://stackoverflow.com/questions/39651979
复制相似问题