Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wrong Drivers ?

Status
Not open for further replies.

jimmYLepp

Programmer
Jan 22, 2002
39
0
0
US
I have created a script that will check out CPU information on another computer vi WMI. When I run the script from my computer (windows 2000 sp 3) and to check the CPU on my own computer I get this error


c:\work\autocheck\checkCPU\test2.vbs(40, 1) (null): 0x80041013


there is only one NT 4.0 computer that this sxcript will work on. BUT if I take the script to a neighboring winows 2000 sp 3 station runs the script against all of the servers/boxes without problem. Has anybody seen this problem before? I have tried finding and downloading the latest and greatest wmi stuff from Microsoft, but that didn't seem to help. Below I am including the script, let me know if you have any ideas.




Dim strComputer
Dim objWMIService
Dim objProcessor
Dim inx

'strComputer = "USCHI181122836"

strComputer = "."

Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set objProcessor = objWMIService.ExecQuery("SELECT * FROM Win32_Process")

WScript.Echo "Process " & VBTab & "Process ID " & VBTab & "Thread count : " & VBTab & "KernelModeTime : " & VBTab & _
"UserModeTime : "
WScript.Echo "--------" & VBTab & "-----------" & VBTab & "---------------" & VBTab & "-----------------" & VBTab & _
"--------------" & VBTab & "-------------------"

For each inx in objProcessor
WScript.Echo inx.Name & VBTab & VBTab & inx.ProcessId & VBTab & inx.ThreadCount & VBTab & inx.kernelModeTime & VBTab & _
inx.UserModeTime
Next



jimmY




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top