На главную :: DiamondSteel-ArtНаписать письмо...Карта сайтаПоиск по сайту

На главную :: DiamondSteel-Art

Прежде чем загрузить файл на сервер, сосчитай до ста.
Прежде чем стереть его - до тысячи.

Полезное

   Назад 

Общая информация о компьютере



Иногда бывает необходимо быстро посмотреть конфигурацию компьютера. Решить эту задачу можно многими способами. Один из них при помощи VBS скрипта и WMI.


'*******************************************'
'                                           '
' Скрипт предназначен для отображения       '
' общей информации по выбранному компьютеру '
'                                           '
' (c) DiamondSteel                          '
'                                           '
'*******************************************'

On Error Resume Next

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

Wscript.StdOut.Write "Введите имя или ip адрес компьютера:"
strComputer = Wscript.StdIn.ReadLine


   WScript.Echo
   WScript.Echo "-=[System]================================"
   WScript.Echo
   WScript.Echo "Computer: " & strComputer

   Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
   Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem", "WQL", _
                                          wbemFlagReturnImmediately + wbemFlagForwardOnly)
   For Each objItem In colItems
      WScript.Echo "Caption: " & objItem.Caption
      WScript.Echo "Install Date: " & WMIDateStringToDate(objItem.InstallDate)
      WScript.Echo "ServicePack Major Version: " & objItem.ServicePackMajorVersion
      WScript.Echo
   Next

   Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
   Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem", "WQL", _
                                          wbemFlagReturnImmediately + wbemFlagForwardOnly)
   For Each objItem In colItems
      WScript.Echo "Domain: " & objItem.Domain
      strInitialLoadInfo = Join(objItem.InitialLoadInfo, ",")
      WScript.Echo "Manufacturer: " & objItem.Manufacturer
      WScript.Echo "Model: " & objItem.Model
      strSystemStartupOptions = Join(objItem.SystemStartupOptions, ",")
      WScript.Echo "TotalPhysicalMemory: " & objItem.TotalPhysicalMemory
      WScript.Echo "UserName: " & objItem.UserName
      WScript.Echo
   Next

   WScript.Echo "-=[Processor]============================="
   WScript.Echo

   Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
   Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_Processor", "WQL", _
                                          wbemFlagReturnImmediately + wbemFlagForwardOnly)
   For Each objItem In colItems
      WScript.Echo "Name: " & objItem.Name
      WScript.Echo
   Next

   WScript.Echo "-=[Physical Memory]======================="
   WScript.Echo

   Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
   Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_PhysicalMemory", "WQL", _
                                          wbemFlagReturnImmediately + wbemFlagForwardOnly)
   For Each objItem In colItems
      WScript.Echo "BankLabel: " & objItem.BankLabel
      WScript.Echo "Capacity: " & objItem.Capacity
      WScript.Echo "Speed: " & objItem.Speed
      WScript.Echo
   Next

   WScript.Echo "-=[Disk Drive]============================"
   WScript.Echo

   Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
   Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_DiskDrive", "WQL", _
                                          wbemFlagReturnImmediately + wbemFlagForwardOnly)
   For Each objItem In colItems
      strCapabilityDescriptions = Join(objItem.CapabilityDescriptions, ",")
      WScript.Echo "InterfaceType: " & objItem.InterfaceType
      WScript.Echo "Model: " & objItem.Model
      WScript.Echo "Partitions: " & objItem.Partitions
      strPowerManagementCapabilities = Join(objItem.PowerManagementCapabilities, ",")
      WScript.Echo "Size: " & objItem.Size
      WScript.Echo
   Next

   WScript.Echo "-=[CD-ROM]================================"
   WScript.Echo

   Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
   Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_CDROMDrive", "WQL", _
                                          wbemFlagReturnImmediately + wbemFlagForwardOnly)
   For Each objItem In colItems
      strCapabilityDescriptions = Join(objItem.CapabilityDescriptions, ",")
       WScript.Echo "Caption: " & objItem.Caption
       WScript.Echo "Drive: " & objItem.Drive
       WScript.Echo
   Next

   WScript.Echo "-=[Video Controller]======================"
   WScript.Echo

   Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
   Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_VideoController", "WQL", _
                                          wbemFlagReturnImmediately + wbemFlagForwardOnly)
   For Each objItem In colItems
      strCapabilityDescriptions = Join(objItem.CapabilityDescriptions, ",")
      WScript.Echo "Name: " & objItem.Name
      WScript.Echo "VideoModeDescription: " & objItem.VideoModeDescription
      WScript.Echo
   Next

   WScript.Echo "-=[Sound Device]=========================="
   WScript.Echo

   Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
   Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_SoundDevice", "WQL", _
                                          wbemFlagReturnImmediately + wbemFlagForwardOnly)
   For Each objItem In colItems
      WScript.Echo "Name: " & objItem.Name
   Next

'*******************************************'


Любую фотографию представленную на этом сайте можно купить, как в качестве готового отпечатка, так и в электронном виде, для последующей переработки. Просто свяжитесь со мной.

Система Orphus Яндекс.Метрика

  © DiamondSteel-Art  [ pgt: 0.01 sec. ]      Использование материалов сайта разрешено только с письменного разрешения автора