- UID
- 14
- 积分
- 8264
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-1-4
- 最后登录
- 1970-1-1
|
发表于 2006-7-5 02:11:54
|
显示全部楼层
独立的 Lisp 获取这些是有限制的(要管理权限等,具体可查MS的MSDN中关于WMI部分),在函数库论坛有获取 硬盘、网卡 ID 的函数,至于获取主板和CPU的你可以参照那两个函数自己写出来,下面是利用 VbsEdit 自动生成的一个关于 Processor 的脚本,ProcessorID 就是 CPU ID
[php]
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Processor",,48)
For Each objItem in colItems
WScript.Echo "AddressWidth: " & objItem.AddressWidth
WScript.Echo "Architecture: " & objItem.Architecture
WScript.Echo "Availability: " & objItem.Availability
WScript.Echo "Caption: " & objItem.Caption
WScript.Echo "ConfigManagerErrorCode: " & objItem.ConfigManagerErrorCode
WScript.Echo "ConfigManagerUserConfig: " & objItem.ConfigManagerUserConfig
WScript.Echo "CpuStatus: " & objItem.CpuStatus
WScript.Echo "CreationClassName: " & objItem.CreationClassName
WScript.Echo "CurrentClockSpeed: " & objItem.CurrentClockSpeed
WScript.Echo "CurrentVoltage: " & objItem.CurrentVoltage
WScript.Echo "DataWidth: " & objItem.DataWidth
WScript.Echo "Description: " & objItem.Description
WScript.Echo "DeviceID: " & objItem.DeviceID
WScript.Echo "ErrorCleared: " & objItem.ErrorCleared
WScript.Echo "ErrorDescription: " & objItem.ErrorDescription
WScript.Echo "ExtClock: " & objItem.ExtClock
WScript.Echo "Family: " & objItem.Family
WScript.Echo "InstallDate: " & objItem.InstallDate
WScript.Echo "L2CacheSize: " & objItem.L2CacheSize
WScript.Echo "L2CacheSpeed: " & objItem.L2CacheSpeed
WScript.Echo "LastErrorCode: " & objItem.LastErrorCode
WScript.Echo "Level: " & objItem.Level
WScript.Echo "LoadPercentage: " & objItem.LoadPercentage
WScript.Echo "Manufacturer: " & objItem.Manufacturer
WScript.Echo "MaxClockSpeed: " & objItem.MaxClockSpeed
WScript.Echo "Name: " & objItem.Name
WScript.Echo "OtherFamilyDescription: " & objItem.OtherFamilyDescription
WScript.Echo "PNPDeviceID: " & objItem.PNPDeviceID
WScript.Echo "PowerManagementCapabilities: " & objItem.PowerManagementCapabilities
WScript.Echo "PowerManagementSupported: " & objItem.PowerManagementSupported
WScript.Echo "ProcessorId: " & objItem.ProcessorId
WScript.Echo "ProcessorType: " & objItem.ProcessorType
WScript.Echo "Revision: " & objItem.Revision
WScript.Echo "Role: " & objItem.Role
WScript.Echo "SocketDesignation: " & objItem.SocketDesignation
WScript.Echo "Status: " & objItem.Status
WScript.Echo "StatusInfo: " & objItem.StatusInfo
WScript.Echo "Stepping: " & objItem.Stepping
WScript.Echo "SystemCreationClassName: " & objItem.SystemCreationClassName
WScript.Echo "SystemName: " & objItem.SystemName
WScript.Echo "UniqueId: " & objItem.UniqueId
WScript.Echo "UpgradeMethod: " & objItem.UpgradeMethod
WScript.Echo "Version: " & objItem.Version
WScript.Echo "VoltageCaps: " & objItem.VoltageCaps
WScript.Echo ""
Next
[/php]
关于主板的 VBS,不过这个获取成功的较少
[php]
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_MotherboardDevice",,48)
For Each objItem in colItems
WScript.Echo "Availability: " & objItem.Availability
WScript.Echo "Caption: " & objItem.Caption
WScript.Echo "ConfigManagerErrorCode: " & objItem.ConfigManagerErrorCode
WScript.Echo "ConfigManagerUserConfig: " & objItem.ConfigManagerUserConfig
WScript.Echo "CreationClassName: " & objItem.CreationClassName
WScript.Echo "Description: " & objItem.Description
WScript.Echo "DeviceID: " & objItem.DeviceID
WScript.Echo "ErrorCleared: " & objItem.ErrorCleared
WScript.Echo "ErrorDescription: " & objItem.ErrorDescription
WScript.Echo "InstallDate: " & objItem.InstallDate
WScript.Echo "LastErrorCode: " & objItem.LastErrorCode
WScript.Echo "Name: " & objItem.Name
WScript.Echo "PNPDeviceID: " & objItem.PNPDeviceID
WScript.Echo "PowerManagementCapabilities: " & objItem.PowerManagementCapabilities
WScript.Echo "PowerManagementSupported: " & objItem.PowerManagementSupported
WScript.Echo "PrimaryBusType: " & objItem.PrimaryBusType
WScript.Echo "RevisionNumber: " & objItem.RevisionNumber
WScript.Echo "SecondaryBusType: " & objItem.SecondaryBusType
WScript.Echo "Status: " & objItem.Status
WScript.Echo "StatusInfo: " & objItem.StatusInfo
WScript.Echo "SystemCreationClassName: " & objItem.SystemCreationClassName
WScript.Echo "SystemName: " & objItem.SystemName
WScript.Echo ""
Next[/php]
资料:
http://www.microsoft.com/china/t ... pmgmt/scrcm128.mspx
利用WMI获取硬盘物理ID
http://www.xdcad.net/forum/showthread.php?s=&threadid=461170 |
|