A
Andrew Aronoff
On a few fully-patched XP Pro SP2 systems, the following pseudo-code
throws error 0x80041013:
=====PSEUDO-CODE STARTS HERE=====
Dim oReg : Set oReg = GetObject("winmgmts:root\default:StdRegProv")
'diagnostic point 0
Dim colOS : Set colOS = GetObject("winmgmts:\root\cimv2").ExecQuery _
("Select * from Win32_OperatingSystem")
'diagnostic point 1
On Error Resume Next
For Each oOS in colOS
[test stuff here]
Next
'diagnostic point 2
On Error Goto 0
=====PSEUDO-CODE ENDS HERE=====
If the "On Error Resume Next" line is suppressed, the error message is
reported at the "For Each" line.
At diagnostic point 0, no error is reported, The "Windows Management
Instrumentation" service is running. The local WMI database (in
%SystemRoot%\System32\Wbem\Repository) has been rebuilt without
effect.
At diagnostic point 1:
VarType(colOS) = 9 'colOS is an object, as expected
At diagnostic point 2 with "On Error Resume Next":
Err.Number = 424
Err.Description = Object required
1. Is there a problem in the script code that could explain this
error?
2. Is there any other diagnostic information I could gather to
troubleshoot this problem?
regards, Andy
--
**********
Please send e-mail to: usenet (dot) post (at) aaronoff (dot) com
To identify everything that starts up with Windows, download
"Silent Runners.vbs" at www.silentrunners.org
**********
throws error 0x80041013:
=====PSEUDO-CODE STARTS HERE=====
Dim oReg : Set oReg = GetObject("winmgmts:root\default:StdRegProv")
'diagnostic point 0
Dim colOS : Set colOS = GetObject("winmgmts:\root\cimv2").ExecQuery _
("Select * from Win32_OperatingSystem")
'diagnostic point 1
On Error Resume Next
For Each oOS in colOS
[test stuff here]
Next
'diagnostic point 2
On Error Goto 0
=====PSEUDO-CODE ENDS HERE=====
If the "On Error Resume Next" line is suppressed, the error message is
reported at the "For Each" line.
At diagnostic point 0, no error is reported, The "Windows Management
Instrumentation" service is running. The local WMI database (in
%SystemRoot%\System32\Wbem\Repository) has been rebuilt without
effect.
At diagnostic point 1:
VarType(colOS) = 9 'colOS is an object, as expected
At diagnostic point 2 with "On Error Resume Next":
Err.Number = 424
Err.Description = Object required
1. Is there a problem in the script code that could explain this
error?
2. Is there any other diagnostic information I could gather to
troubleshoot this problem?
regards, Andy
--
**********
Please send e-mail to: usenet (dot) post (at) aaronoff (dot) com
To identify everything that starts up with Windows, download
"Silent Runners.vbs" at www.silentrunners.org
**********