Vista 中的 WMI 中是否缺少 Win32_PerfFormattedData_PerfDisk_PhysicalDisk?
据我了解,以下脚本的输出在 Windows XP 及更高版本中应包含“Win32_PerfRawData_PerfDisk_PhysicalDisk”,但在 Vista Business 32 位 Service Pack 2 中不适合我。到目前为止,我在谷歌上搜索有关以下内容的信息非常不成功本次表演课。
strComputer = "."
Set objWMIService=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\cimv2")
For Each objclass in objWMIService.SubclassesOf()
Wscript.Echo objClass.Path_.Class
Next
Vista 中是否根本不存在此 WMI 类?如果只有我一个人,有办法修复WMI吗?我已经尝试运行 winmgmt /resetrepository 和 winmgmt /resyncperf 但都没有帮助。
编辑:排序和编辑的输出
剪切...
- Win32_PerfFormattedData_NETFramework_NETCLRSecurity
- Win32_PerfFormattedData_Outlook_Outlook
- Win32_PerfFormattedData_PerfNet_Browser
- Win32_PerfFormattedData_PerfNet_Redirector
剪切...
Win32_PerfFormattedData_PerfDisk_* 丢失。
还尝试了 lodctr /R。没有帮助。
已解决
这些计数器可以在注册表中禁用。只需将 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Perfdisk\Performance\Disable Performance Counters 设置为 0 并重新启动即可。
From what I understand, the output from the following script should include "Win32_PerfRawData_PerfDisk_PhysicalDisk" in Windows XP and higher, but it doesn't for me in Vista Business 32-bit Service Pack 2. Thus far I have been very unsuccessful googling for information about this performance class.
strComputer = "."
Set objWMIService=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\cimv2")
For Each objclass in objWMIService.SubclassesOf()
Wscript.Echo objClass.Path_.Class
Next
Does this WMI class simply not exist in Vista? If it is just me, is there a way to fix WMI? I have already tried running winmgmt /resetrepository and winmgmt /resyncperf and neither helps.
Edit: Sorted and Edited Output
snip...
- Win32_PerfFormattedData_NETFramework_NETCLRSecurity
- Win32_PerfFormattedData_Outlook_Outlook
- Win32_PerfFormattedData_PerfNet_Browser
- Win32_PerfFormattedData_PerfNet_Redirector
snip...
Win32_PerfFormattedData_PerfDisk_* is missing.
Also tried lodctr /R. No help.
SOLVED
These counters can be disabled in the registry. Just set HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Perfdisk\Performance\Disable Performance Counters to 0 and reboot.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Vista 应该没问题。文档此处在底部声明页面:
您能否检查一下您的机器上是否存在
WmiPerfInst.dll
DLL?另一件要尝试的事情是看看是否可以从相应的 RawData 类中获取统计信息? Vista 似乎改变了原始数据转换为熟数据的方式。我对此的了解非常薄弱(基于非常粗略的 Google 搜索),因为我只涉及 XP/Svr2k3/Svr2k8 上的 WMI - 我认为没有人实际上使用 Vista :- )
而且,如果您要接受我的答案,即使它没有帮助,至少让我抄袭您的解决方案:-)
但说实话,谢谢你。在某些时候,我们可能必须自己支持后 Vista,因此这将帮助我们了解这一点。
Should be okay on Vista. the docs here state at the bottom of the page:
Can you check that the
WmiPerfInst.dll
DLL exists on your box?Another things to try is to see if you can get stats from the corresponding RawData class? Vista appears to have changed the way in which raw data is translated to cooked data. My knowledge of that is pretty thin (based on a very cursory Google search) since I'm only involved in WMI on XP/Svr2k3/Svr2k8 - I didn't think anyone was actually using Vista :-)
And, if you're going to accept my answer even though it didn't help, at least let me plagiarise your solution :-)
But seriously, thanks for that. At some point, we'll probably have to support post-Vista ourselves so it'll help us out to know this.