kif » 14.02.2005 (Пн) 11:37
Dim sServer
sServer = "."
DoWin32_ComputerSystem
Sub DoWin32_ComputerSystem
On Error Resume Next
Dim SWbemLocator
Set SWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Dim SWbemServices
Set SWbemServices = SWbemLocator.ConnectServer(sServer,"root\CIMV2")
Dim objWbemObjectSet
Set objWbemObjectSet = SWbemServices.ExecQuery("Select * From Win32_ComputerSystem", "WQL")
Dim sProperty
For Each sProperty in objWbemObjectSet
DoWrite "AdminPasswordStatus", DoCheckIfEmpty(sProperty.AdminPasswordStatus)
DoWrite "AutomaticResetBootOption", DoCheckIfEmpty(sProperty.AutomaticResetBootOption)
DoWrite "AutomaticResetCapability", DoCheckIfEmpty(sProperty.AutomaticResetCapability)
DoWrite "BootOptionOnLimit", DoCheckIfEmpty(sProperty.BootOptionOnLimit)
DoWrite "BootOptionOnWatchDog", DoCheckIfEmpty(sProperty.BootOptionOnWatchDog)
DoWrite "BootROMSupported", DoCheckIfEmpty(sProperty.BootROMSupported)
DoWrite "BootupState", DoCheckIfEmpty(sProperty.BootupState)
DoWrite "Caption", DoCheckIfEmpty(sProperty.Caption)
DoWrite "ChassisBootupState", DoCheckIfEmpty(sProperty.ChassisBootupState)
DoWrite "CreationClassName", DoCheckIfEmpty(sProperty.CreationClassName)
DoWrite "CurrentTimeZone", DoCheckIfEmpty(sProperty.CurrentTimeZone)
DoWrite "DaylightInEffect", DoCheckIfEmpty(sProperty.DaylightInEffect)
DoWrite "Description", DoCheckIfEmpty(sProperty.Description)
DoWrite "Domain", DoCheckIfEmpty(sProperty.Domain)
DoWrite "DomainRole", DoCheckIfEmpty(sProperty.DomainRole)
DoWrite "EnableDaylightSavingsTime", DoCheckIfEmpty(sProperty.EnableDaylightSavingsTime)
DoWrite "FrontPanelResetStatus", DoCheckIfEmpty(sProperty.FrontPanelResetStatus)
DoWrite "InfraredSupported", DoCheckIfEmpty(sProperty.InfraredSupported)
For aWMI = LBound(sProperty.InitialLoadInfo) To UBound(sProperty.InitialLoadInfo)
DoWrite "InitialLoadInfo", DoCheckIfEmpty(sProperty.InitialLoadInfo(aWMI))
Next
DoWrite "InstallDate", DoCheckIfEmpty(sProperty.InstallDate)
DoWrite "KeyboardPasswordStatus", DoCheckIfEmpty(sProperty.KeyboardPasswordStatus)
DoWrite "LastLoadInfo", DoCheckIfEmpty(sProperty.LastLoadInfo)
DoWrite "Manufacturer", DoCheckIfEmpty(sProperty.Manufacturer)
DoWrite "Model", DoCheckIfEmpty(sProperty.Model)
DoWrite "Name", DoCheckIfEmpty(sProperty.Name)
DoWrite "NameFormat", DoCheckIfEmpty(sProperty.NameFormat)
DoWrite "NetworkServerModeEnabled", DoCheckIfEmpty(sProperty.NetworkServerModeEnabled)
DoWrite "NumberOfProcessors", DoCheckIfEmpty(sProperty.NumberOfProcessors)
For aWMI = LBound(sProperty.OEMLogoBitmap) To UBound(sProperty.OEMLogoBitmap)
DoWrite "OEMLogoBitmap", DoCheckIfEmpty(sProperty.OEMLogoBitmap(aWMI))
Next
For aWMI = LBound(sProperty.OEMStringArray) To UBound(sProperty.OEMStringArray)
DoWrite "OEMStringArray", DoCheckIfEmpty(sProperty.OEMStringArray(aWMI))
Next
DoWrite "PartOfDomain", DoCheckIfEmpty(sProperty.PartOfDomain)
DoWrite "PauseAfterReset", DoCheckIfEmpty(sProperty.PauseAfterReset)
For aWMI = LBound(sProperty.PowerManagementCapabilities) To UBound(sProperty.PowerManagementCapabilities)
DoWrite "PowerManagementCapabilities", DoCheckIfEmpty(sProperty.PowerManagementCapabilities(aWMI))
Next
DoWrite "PowerManagementSupported", DoCheckIfEmpty(sProperty.PowerManagementSupported)
DoWrite "PowerOnPasswordStatus", DoCheckIfEmpty(sProperty.PowerOnPasswordStatus)
DoWrite "PowerState", DoCheckIfEmpty(sProperty.PowerState)
DoWrite "PowerSupplyState", DoCheckIfEmpty(sProperty.PowerSupplyState)
DoWrite "PrimaryOwnerContact", DoCheckIfEmpty(sProperty.PrimaryOwnerContact)
DoWrite "PrimaryOwnerName", DoCheckIfEmpty(sProperty.PrimaryOwnerName)
DoWrite "ResetCapability", DoCheckIfEmpty(sProperty.ResetCapability)
DoWrite "ResetCount", DoCheckIfEmpty(sProperty.ResetCount)
DoWrite "ResetLimit", DoCheckIfEmpty(sProperty.ResetLimit)
For aWMI = LBound(sProperty.Roles) To UBound(sProperty.Roles)
DoWrite "Roles", DoCheckIfEmpty(sProperty.Roles(aWMI))
Next
DoWrite "Status", DoCheckIfEmpty(sProperty.Status)
For aWMI = LBound(sProperty.SupportContactDescription) To UBound(sProperty.SupportContactDescription)
DoWrite "SupportContactDescription", DoCheckIfEmpty(sProperty.SupportContactDescription(aWMI))
Next
DoWrite "SystemStartupDelay", DoCheckIfEmpty(sProperty.SystemStartupDelay)
For aWMI = LBound(sProperty.SystemStartupOptions) To UBound(sProperty.SystemStartupOptions)
DoWrite "SystemStartupOptions", DoCheckIfEmpty(sProperty.SystemStartupOptions(aWMI))
Next
DoWrite "SystemStartupSetting", DoCheckIfEmpty(sProperty.SystemStartupSetting)
DoWrite "SystemType", DoCheckIfEmpty(sProperty.SystemType)
DoWrite "ThermalState", DoCheckIfEmpty(sProperty.ThermalState)
DoWrite "TotalPhysicalMemory", DoCheckIfEmpty(sProperty.TotalPhysicalMemory)
DoWrite "UserName", DoCheckIfEmpty(sProperty.UserName)
DoWrite "WakeUpType", DoCheckIfEmpty(sProperty.WakeUpType)
DoWrite "Workgroup", DoCheckIfEmpty(sProperty.Workgroup)
Wscript.Echo
Next
End Sub
Function DoCheckIfEmpty(sValue)
If IsNull(sValue) Then
DoCheckIfEmpty = "Empty"
Else
DoCheckIfEmpty = sValue
End If
End Function
Sub DoWrite(sText, sValue)
WScript.Echo sText & DoFormat(sText), sValue
End Sub
Function DoFormat(sText)
DoFormat = Space(28 - Len(sText)) & " = "
End Function
Братья и сестры, что вы делаете???
Ведь вы же братья и сестры.