Sobre CompInfo

Tus preguntas. Algoritmos o Grupos de Comandos formando Programas Escripts.
Responder
Jonny
Profesional del Autoit
Mensajes: 1042
Registrado: 30 Jun 2008, 20:08

Sobre CompInfo

Mensaje por Jonny »

¿Sabéis por qué al intentar obtener según que datos de algún componente hardware con la UDF CompInfo no se obtiene nada?.

Por ejemplo (sólo es un ejemplo porque me pasa con montones de cosas), al intentar obtener el número de serie de la memoria obtengo "".

La UDF ha de ir bien, y los drivers del equipo están correctamente, porque además, es que por ejemplo el nombre sí que lo devuelve bien.
En cambio, el número de serie de cualquier disco lo obtengo sin problemas...

Salu2!
Avatar de Usuario
Ximorro
Profesional del Autoit
Mensajes: 1500
Registrado: 10 Jul 2009, 12:35
Ubicación: Castellón, España

Re: Sobre CompInfo

Mensaje por Ximorro »

Bueno, supongo que todos los dispositivos no ofrecen toda la información. También puede ser el método de toma de datos. Por lo que veo el programa accede por WMI, y quizás el hw no tiene los datos disponibles por ahí.
Por cierto ¡nos podías haber puesto el enlace a la librería y el código para ver un ejemplo! Te lo dejo como deber ;-)

A mí los datos de una memoria me salen estos, como puedes ver efectivamente faltan muchos pero no creo que sea culpa de la UDF, simplemente esos datos no son consultables por WMI:
Memoria.PNG
Memoria.PNG (8.56 KiB) Visto 6904 veces
"¿Y no será que en este mundo hay cada vez más gente y menos personas?". Mafalda (Quino)
Jonny
Profesional del Autoit
Mensajes: 1042
Registrado: 30 Jun 2008, 20:08

Re: Sobre CompInfo

Mensaje por Jonny »

http://www.emesn.com/autoitforum/viewto ... f=2&t=2533
:)
me imaginaba que pudiera ser algo de eso (del WMI).
¿Alguna otra forma de obtener esos datos que no están disponibles por WMI?...

Quizá accediendo a los drivers directamente, pero lo descarto, ni papa de drivers :).

Salu2!
!
Jonny
Profesional del Autoit
Mensajes: 1042
Registrado: 30 Jun 2008, 20:08

Re: Sobre CompInfo

Mensaje por Jonny »

Vaya. He recordado el Everest, lo he probado... y ni punto de comparación con lo que se obtiene con CompInfo :). ¡vaya máquina de programa! (el Everest).

¿Como obtendrá toda esa info?.

Desde luego por WMI no. Lo más probable es que lo haga como dije, con los drivers directamente...

Salu2!
Jonny
Profesional del Autoit
Mensajes: 1042
Registrado: 30 Jun 2008, 20:08

Re: Sobre CompInfo

Mensaje por Jonny »

Estoy investigando un poco esto de la identificación de hardware, porque me parece extraño que CompInfo no devuelva muchos de los datos, y Everest devuelva bien todos los datos, incluso más de los que ofrece CompInfo (o distintos incluso).
Ximorro dijo:
Bueno, supongo que todos los dispositivos no ofrecen toda la información. También puede ser el método de toma de datos. Por lo que veo el programa accede por WMI, y quizás el hw no tiene los datos disponibles por ahí.
¿Qué otras formas hay para acceder a la info del hardware?.
He estado buscando por Google como obtener la info a través de los drivers, pero no encuentro nada, más que programas tipo Everest. Que no quiere decir que lo haga así, si no que en todas partes dicen como obtener la info del hardware con programas, no a mano para implementarlo con programación.

Estoy viendo, que sí podría ser cosa de la librería el hecho de que no devuelva bien la info.

Buscando y buscando por el foro, un post de hace tiempo donde alguien compartió un programa para obtener los drivers del equipo, hablando precisamente de drivers (que por cierto no encuentro este post), para ver una web que había donde explicaban el lenguaje ese que usan los drivers en los archivos .inf, he visto el scriptomatic que puse ya hace un tiempecillo.
Así, que lo he recuperado de entre los scripts de ejemplo que tengo, y me he puesto a trastearlo...

Y he visto la clase "root\CIMV2\Win32_BaseBoard", que nos genera este código:

Código: Seleccionar todo

; Generated by AutoIt Scriptomatic

$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20
$colItems = ""
$strComputer = "localhost"

$Output=""
$Output = $Output & "Computer: " & $strComputer  & @CRLF
$Output = $Output & "==========================================" & @CRLF
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BaseBoard", "WQL", _
                                          $wbemFlagReturnImmediately + $wbemFlagForwardOnly)

If IsObj($colItems) then
   For $objItem In $colItems
      $Output = $Output & "Caption: " & $objItem.Caption & @CRLF
      $strConfigOptions = $objItem.ConfigOptions(0)
      $Output = $Output & "ConfigOptions: " & $strConfigOptions & @CRLF
      $Output = $Output & "CreationClassName: " & $objItem.CreationClassName & @CRLF
      $Output = $Output & "Depth: " & $objItem.Depth & @CRLF
      $Output = $Output & "Description: " & $objItem.Description & @CRLF
      $Output = $Output & "Height: " & $objItem.Height & @CRLF
      $Output = $Output & "HostingBoard: " & $objItem.HostingBoard & @CRLF
      $Output = $Output & "HotSwappable: " & $objItem.HotSwappable & @CRLF
      $Output = $Output & "InstallDate: " & WMIDateStringToDate($objItem.InstallDate) & @CRLF
      $Output = $Output & "Manufacturer: " & $objItem.Manufacturer & @CRLF
      $Output = $Output & "Model: " & $objItem.Model & @CRLF
      $Output = $Output & "Name: " & $objItem.Name & @CRLF
      $Output = $Output & "OtherIdentifyingInfo: " & $objItem.OtherIdentifyingInfo & @CRLF
      $Output = $Output & "PartNumber: " & $objItem.PartNumber & @CRLF
      $Output = $Output & "PoweredOn: " & $objItem.PoweredOn & @CRLF
      $Output = $Output & "Product: " & $objItem.Product & @CRLF
      $Output = $Output & "Removable: " & $objItem.Removable & @CRLF
      $Output = $Output & "Replaceable: " & $objItem.Replaceable & @CRLF
      $Output = $Output & "RequirementsDescription: " & $objItem.RequirementsDescription & @CRLF
      $Output = $Output & "RequiresDaughterBoard: " & $objItem.RequiresDaughterBoard & @CRLF
      $Output = $Output & "SerialNumber: " & $objItem.SerialNumber & @CRLF
      $Output = $Output & "SKU: " & $objItem.SKU & @CRLF
      $Output = $Output & "SlotLayout: " & $objItem.SlotLayout & @CRLF
      $Output = $Output & "SpecialRequirements: " & $objItem.SpecialRequirements & @CRLF
      $Output = $Output & "Status: " & $objItem.Status & @CRLF
      $Output = $Output & "Tag: " & $objItem.Tag & @CRLF
      $Output = $Output & "Version: " & $objItem.Version & @CRLF
      $Output = $Output & "Weight: " & $objItem.Weight & @CRLF
      $Output = $Output & "Width: " & $objItem.Width & @CRLF
      if Msgbox(1,"WMI Output",$Output) = 2 then ExitLoop
      $Output=""
   Next
Else
   Msgbox(0,"WMI Output","No WMI Objects Found for class: " & "Win32_BaseBoard" )
Endif


Func WMIDateStringToDate($dtmDate)

	Return (StringMid($dtmDate, 5, 2) & "/" & _
	StringMid($dtmDate, 7, 2) & "/" & StringLeft($dtmDate, 4) _
	& " " & StringMid($dtmDate, 9, 2) & ":" & StringMid($dtmDate, 11, 2) & ":" & StringMid($dtmDate,13, 2))
EndFunc
que ejecutándolo, me devuelve esto:

Código: Seleccionar todo

Computer: localhost
==========================================
Caption: Placa base
ConfigOptions: 
CreationClassName: Win32_BaseBoard
Depth: 
Description: Placa base
Height: 
HostingBoard: True
HotSwappable: 
InstallDate: // ::
Manufacturer: ASUSTeK Computer INC.
Model: 
Name: Placa base
OtherIdentifyingInfo: 
PartNumber: 
PoweredOn: True
Product: P5W DH Deluxe
Removable: 
Replaceable: 
RequirementsDescription: 
RequiresDaughterBoard: 
SerialNumber: MB-1234567890
SKU: 
SlotLayout: 
SpecialRequirements: 
Status: 
Tag: Base Board
Version: Rev 1.xx
Weight: 
Width:
En cambio, la función "_ComputerGetMotherboard()" de CompInfo, con el siguiente código:

Código: Seleccionar todo

#include <CompInfo.au3>
Dim $Motherboard
_ComputerGetMotherboard($Motherboard)
For $i=1 To $Motherboard[0][0] Step 1
MsgBox(0, "", "Name: "&$Motherboard[$i][0]&@CRLF& _
"Availability: "&$Motherboard[$i][1]&@CRLF& _
"Config manager error code: "&$Motherboard[$i][2]&@CRLF& _
"Config manager user config: "&$Motherboard[$i][3]&@CRLF& _
"Description: "&$Motherboard[$i][4]&@CRLF& _
"Creation class name: "&$Motherboard[$i][5]&@CRLF& _
"Device ID: "&$Motherboard[$i][6]&@CRLF& _
"Error cleared: "&$Motherboard[$i][7]&@CRLF& _
"Error description: "&$Motherboard[$i][8]&@CRLF& _
"Last error code: "&$Motherboard[$i][9]&@CRLF& _
"PNP device ID: "&$Motherboard[$i][10]&@CRLF& _
"Power management capabilities: "&$Motherboard[$i][11]&@CRLF& _
"Power management supported: "&$Motherboard[$i][12]&@CRLF& _
"Primary bus type: "&$Motherboard[$i][13]&@CRLF& _
"Revision number: "&$Motherboard[$i][14]&@CRLF& _
"Secondary bus type: "&$Motherboard[$i][15]&@CRLF& _
"Status: "&$Motherboard[$i][16]&@CRLF& _
"Status info: "&$Motherboard[$i][17]&@CRLF& _
"System creation class name: "&$Motherboard[$i][18]&@CRLF& _
"System name: "&$Motherboard[$i][19])
Next
Me devuelve:

Código: Seleccionar todo

Name: Placa madre
Availability: 
Config manager error code: 
Config manager user config: 
Description: Placa madre
Creation class name: Win32_MotherBoardDevice
Device ID: Motherboard
Error cleared: 
Error description: 
Last error code: 
PNP device ID: 
Power management capabilities: 
Power management supported: 
Primary bus type: PCI
Revision number: 
Secondary bus type: ISA
Status: 
Status info: 
System creation class name: Win32_ComputerSystem
System name: Jonny
(Me quedo con lo primero, identifica mejor la placa base).

Y ahora, vamos con Everest...:

Código: Seleccionar todo

Propiedades del motherboard	
Identificación del motherboard	64-2206-000010-00101111-072407-975X$A0543000_BIOS DATE: 07/24/07 22:51:18 VER: 08.00.12
Nombre del motherboard	Asus P5W DH Deluxe
	
Propiedades del bus principal	
Tipo de bus	Intel AGTL+
Ancho de bus	64 bit
Reloj real	200 MHz (QDR)
Reloj efectivo	800 MHz
Ancho de banda	6400 MB/s
	
Propiedades del bus de memoria	
Tipo de bus	Dual DDR2 SDRAM
Ancho de bus	128 bit
Relación DRAM:FSB	10:6
Reloj real	333 MHz (DDR)
Reloj efectivo	667 MHz
Ancho de banda	10667 MB/s
	
Propiedades del bus del chipset	
Tipo de bus	Intel Direct Media Interface
	
Información física del motherboard	
CPU sockets/slots	1 LGA775
Slots de expansión	3 PCI, 2 PCI-E x1, 2 PCI-E x16
Slots de RAM	4 DDR2 DIMM
Dispositivos integrados	Audio, Dual Gigabit LAN, IEEE-1394
Forma	ATX
Tamaño del motherboard	240 mm x 300 mm
Chipset del motherboard	i975X
Caraterísticas extra	Asus Intelligence, JumperFree, Q-Fan 2, Stepless Freq Selection, SATA-II, RAID
	
Fabricante del motherboard	
Nombre de la empresa	ASUSTeK Computer Inc.
Información del producto	http://www.asus.com/ProductGroup2.aspx?PG_ID=mKyCKlQ4oSEtSu5m
Descarga del BIOS	http://support.asus.com/download/download.aspx?SLanguage=en-us
Actualización del controlador	http://driveragent.com?ref=59
Actualizaciones del BIOS	http://www.esupport.com/biosagent/index.cfm?refererid=40
¡Me quedo con esto! :).

Parece, que esta info la ha sacado de lo que en CompInfo serían varias funciones. Por lo menos, de "_ComputerGetBios()", "_ComputerGetMotherboard()" y "_ComputerGetProcessors()", y no se si alguna más.
Pero, de todas formas, aún con los resultados de todas esas funciones no se llega a obtener la misma info que ofrece Everest...

Así, que la conclusión es:

Que por algún extraño motivo (quizá lo que decía Ximorro de que haya información que no esté disponible mediante WMI) CompInfo no devuelve bien la info del hardware (pasa con todas las funciones), pero en cambio, hay clases del WMI que dan bien parte de la info que las funciones de CompInfo devuelven como "".
Así, que no se el por qué, pero eso me hace pensar, que esta UDF no está muy bien... y, que quizá investigando bien el WMI, pueda llegarse a obtener la misma info que ofrece Everest...

¿Qué os parece?.

Tampoco entiendo, esos datos que intenta devolver CompInfo, que ni en la clase primera de WMI que he puesto ni en Everest aparecen...

Edit:

Confirmado :) :

Como me temía, la UDF CompInfo consulta una clase WMI que parece no ir demasiado bien, o por lo menos no proporciona demasiada info, respecto a la que he puesto antes, si es que sólo hay esa (además de la que consulta CompInfo) respecto a la placa base, por seguir el ejemplo de lo que ponía antes.

Mirando y mirando las clases WMI en el Scriptomatic, acabo de ver la clase "root\CIMV2\Win32_MotherboardDevice", que efectivamente devuelve la misma info que la función "_ComputerGetMotherboard()"

Así, que creo que esto tiene que ser cosa de mucha paciencia y sobre todo conocer WMI de "p" a "pa"... :).
Eso sí, es un poco rollo eso de que la info esté tan dispersa...

Salu2!
Jonny
Profesional del Autoit
Mensajes: 1042
Registrado: 30 Jun 2008, 20:08

Re: Sobre CompInfo

Mensaje por Jonny »

Vaya, sale como última respuesta el post que puse ayer...

Salu2!
Avatar de Usuario
BasicOs
Site Admin
Mensajes: 2085
Registrado: 21 Nov 2006, 19:24
Ubicación: El Internet - (Canarias, España)
Contactar:

Re: Sobre CompInfo

Mensaje por BasicOs »

Aquí hay un programa que la usa y que va muy bien. Puedes usar el código y las estructuras de uso de compinfo:

http://www.autoit.de/index.php?page=Att ... 5bba153ec6

de:
http://www.autoit.de/index.php?page=Thr ... eadID=7080

Código: Seleccionar todo

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=prog.ico
#AutoIt3Wrapper_Outfile=Computer-Info2.exe
#AutoIt3Wrapper_UseUpx=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include <Constants.au3>
#include <TabConstants.au3>
#include <Date.au3>
#include <Inet.au3>
#include <GuiListView.au3>
#include <ListViewConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <WindowsConstants.au3>

Opt('GUIOnEventMode', 1)
Opt('MustDeclareVars', 1)

Global $sTitle = 'Computer-Info v2.0'
Global $hGUI, $hTab, $hStatus, $iWidth
Global $aTabNames[15] = [ _
		'Windows', 'Laufwerke', 'Festplatten', 'CDROM', 'Netzwerk', _
		'Netzwerkadapter', 'Prozessor', 'RAM', 'Grafikkarte', 'Monitor', _
		'Drucker', 'Soundkarte', 'Mainboard', 'Steckplätze', 'Info']
Global $ahTabIDs[UBound($aTabNames)], $ahContent[UBound($aTabNames)]

If @OSType <> 'WIN32_NT' Then Exit MsgBox(48, $sTitle, 'Das Programm funktioniert erst ab Windows 2000')

If (Not @Compiled) And (@AutoItVersion < '3.3.0.0') Then
	Global $Msg = 'Dieses Script benötigt min. die AutoIt-Version: 3.3.0.0 ' & @CRLF & @CRLF
	$Msg &= 'Gestartet wurde es mit AutoIt-Version: ' & @AutoItVersion
	Exit MsgBox(48, $sTitle, $Msg)
EndIf
$iWidth = @DesktopWidth - 20
If $iWidth > 950 Then $iWidth = 950

$hGUI = GUICreate($sTitle, $iWidth, 520, Default, 120, BitOR($WS_MAXIMIZEBOX, $WS_SIZEBOX))
GUISetOnEvent($GUI_EVENT_CLOSE, '_End')
If FileExists(@ScriptDir & '\prog.ico') Then
	GUISetIcon(@ScriptDir & '\prog.ico', -1)
Else
	GUISetIcon('shell32.dll', -13)
EndIf
$hTab = GUICtrlCreateTab(10, 10, $iWidth - 20, 450)
GUICtrlSetOnEvent(-1, '_TabClick')
GUICtrlSetResizing(-1, 2 + 4 + 32 + 64)
For $i = 0 To UBound($aTabNames) - 1
	$ahTabIDs[$i] = GUICtrlCreateTabItem($aTabNames[$i])
	$ahContent[$i] = GUICtrlCreateListView(' | ', 22, 42, $iWidth - 45, 405, $LVS_NOCOLUMNHEADER)
	GUICtrlSetResizing(-1, 2 + 4 + 32 + 64)
	GUICtrlSetBkColor(-1, 0xffffcc)
Next
GUICtrlCreateTabItem('')
$hStatus = _GUICtrlStatusBar_Create($hGUI)
GUIRegisterMsg($WM_SIZE, 'WM_SIZE')
GUIRegisterMsg($WM_GETMINMAXINFO, 'MY_WM_GETMINMAXINFO')
_CallFunction(0)
GUISetState()

While True
	Sleep(1000)
WEnd

Func _End()
	Exit
EndFunc   ;==>_End

Func _TabClick()
	Local $iFunctionNr
	$iFunctionNr = GUICtrlRead($hTab)
	_CallFunction($iFunctionNr)
EndFunc   ;==>_TabClick

Func _CallFunction($iFunctionNr)
	Local $sMsg = 'Fertig.', $aInfo
	_GUICtrlStatusBar_SetText($hStatus, 'Bitte warten...')
	_GUICtrlListView_BeginUpdate($ahContent[$iFunctionNr])
	_GUICtrlListView_DeleteAllItems($ahContent[$iFunctionNr])
	Switch $iFunctionNr
		Case 0
			$aInfo = _CI_GetWindowsInfo()
		Case 1
			$aInfo = _CI_GetLogicalDisk()
		Case 2
			$aInfo = _CI_GetHarddrives()
		Case 3
			$aInfo = _CI_GetCDROM()
		Case 4
			$aInfo = _CI_GetNetwork()
		Case 5
			$aInfo = _CI_GetNetworkAdapter()
		Case 6
			$aInfo = _CI_GetCPU()
		Case 7
			$aInfo = _CI_GetRAM()
		Case 8
			$aInfo = _CI_GetVideoController()
		Case 9
			$aInfo = _CI_GetMonitor()
		Case 10
			$aInfo = _CI_GetPrinter()
		Case 11
			$aInfo = _CI_GetSoundDevice()
		Case 12
			$aInfo = _CI_GetMainBoard()
		Case 13
			$aInfo = _CI_GetSystemSlot()
		Case 14
			$aInfo = _CI_GetProgInfo()
	EndSwitch
	If Not @error Then
		For $i = 1 To UBound($aInfo) - 1
			Switch $iFunctionNr
				Case 0, 4, 12, 14
					GUICtrlCreateListViewItem('', $ahContent[$iFunctionNr])
				Case Else
					GUICtrlCreateListViewItem($i & '.| ', $ahContent[$iFunctionNr])
			EndSwitch
			For $j = 0 To UBound($aInfo, 2) - 1
				GUICtrlCreateListViewItem($aInfo[0][$j] & '|' & $aInfo[$i][$j], $ahContent[$iFunctionNr])
			Next
			GUICtrlCreateListViewItem(' | ', $ahContent[$iFunctionNr])
		Next
	Else
		$sMsg = 'Fehler: ' & @error
	EndIf
	_GUICtrlListView_SetColumnWidth($ahContent[$iFunctionNr], 0, $LVSCW_AUTOSIZE)
	_GUICtrlListView_SetColumnWidth($ahContent[$iFunctionNr], 1, $LVSCW_AUTOSIZE)
	_GUICtrlListView_EndUpdate($ahContent[$iFunctionNr])
	_GUICtrlStatusBar_SetText($hStatus, $sMsg)
EndFunc   ;==>_CallFunction

Func _CI_GetWindowsInfo($strComputer = '.')
	Local $aReturn[2][17] = [[ _
			'Betriebssystem:', 'Version:', 'Sprachversion:', 'Tastatur:', 'Boot-Laufwerk:', 'Windows-Verzeichnis:', _
			'Speicherplatz:', 'Hauptspeicher:', 'Auslagerungsdatei:', 'Installationsdatum:', 'Zuletzt gestartet:', _
			'Heutiges Datum:', 'Benutzername:', 'Benutzerverzeichnis:', 'Produktkey:', 'Hintergrundbild:', 'Bildschirmschoner:']]
	Local $aTmp, $sOSLang = @OSLang, $sKBLayout = @KBLayout, $sDigitalProductID, $sWallpaper = 'Nicht vorhanden', $sScreenSaver = 'Nicht vorhanden'
	Local $x = 0, $objWMIService, $colItems, $aMemory = MemGetStats(), $sX64 = ''
	$aTmp = DllCall('kernel32.dll', 'int', 'GetLocaleInfo', 'dword', '0x' & $sOSLang, 'dword', BitOR(0x2, 0x80000000), 'str', '', 'int', 85)
	If IsArray($aTmp) Then $sOSLang = $aTmp[3]
	$aTmp = DllCall('kernel32.dll', 'int', 'GetLocaleInfo', 'dword', '0x' & $sKBLayout, 'dword', BitOR(0x2, 0x80000000), 'str', '', 'int', 85)
	If IsArray($aTmp) Then $sKBLayout = $aTmp[3]
	If @OSArch <> 'X86' Then $sX64 = '64'
	$sDigitalProductID = RegRead('HKEY_LOCAL_MACHINE' & $sX64 & '\SOFTWARE\Microsoft\Windows NT\CurrentVersion', 'DigitalProductID')
	$objWMIService = ObjGet('winmgmts:\\' & $strComputer & '\root\cimv2')
	If Not IsObj($objWMIService) Then Return SetError(1, 0, 0)
	$colItems = $objWMIService.ExecQuery('SELECT * FROM Win32_Desktop', 'WQL', 0x30)
	If IsObj($colItems) Then
		For $objItem In $colItems
			If StringInStr($objItem.Name, @UserName) Then
				If $objItem.Wallpaper <> '' Then $sWallpaper = $objItem.Wallpaper
				If $objItem.ScreenSaverExecutable <> '' Then $sScreenSaver = $objItem.ScreenSaverExecutable
			EndIf
		Next
	EndIf
	$colItems = $objWMIService.ExecQuery('SELECT * FROM Win32_OperatingSystem', 'WQL', 0x30)
	If IsObj($colItems) Then
		For $objItem In $colItems
			$aReturn[1][0] = $objItem.Caption & ' (' & @OSArch & ')'
			$aReturn[1][1] = $objItem.Version
			$aReturn[1][2] = $sOSLang
			$aReturn[1][3] = $sKBLayout
			$aReturn[1][4] = $objItem.BootDevice
			$aReturn[1][5] = $objItem.WindowsDirectory
			$aReturn[1][6] = 'Laufwerk "' & $objItem.SystemDrive & '\"   ' & _ByteAutoSize(DriveSpaceTotal($objItem.SystemDrive) * 2 ^ 20)
			$aReturn[1][6] &= ' (' & _ByteAutoSize(DriveSpaceFree($objItem.SystemDrive) * 2 ^ 20) & ' frei)'
			$aReturn[1][7] = _ByteAutoSize($aMemory[1] * 1024, 0, 3)
			$aReturn[1][8] = _ByteAutoSize($objItem.SizeStoredInPagingFiles * 1024, 0, 3)
			$aReturn[1][9] = _WMIDateStringToDate($objItem.InstallDate)
			$aReturn[1][10] = _WMIDateStringToDate($objItem.LastBootUpTime)
			$aReturn[1][11] = _NowCalc()
			$aReturn[1][12] = @UserName
			$aReturn[1][13] = @UserProfileDir
			$aReturn[1][14] = _DecodeProductKey($sDigitalProductID)
			$aReturn[1][15] = $sWallpaper
			$aReturn[1][16] = $sScreenSaver
		Next
	EndIf
	Return $aReturn
EndFunc   ;==>_CI_GetWindowsInfo

Func _CI_GetLogicalDisk($strComputer = '.')
	Local $aReturn[1][9] = [[ _
			'Laufwerk:', 'Beschreibung:', 'Netzwerkpfad:', 'Zugriff:', 'Größe:', 'Freier Speicher:', _
			'Dateisystem:', 'Datenträgername:', 'Seriennr. (Datenträger):']]
	Local $x = 0, $objWMIService, $colItems, $aAccess[2] = ['R/W', 'R']
	$objWMIService = ObjGet('winmgmts:\\' & $strComputer & '\root\cimv2')
	If Not IsObj($objWMIService) Then Return SetError(1, 0, 0)
	$colItems = $objWMIService.ExecQuery('SELECT * FROM Win32_LogicalDisk', 'WQL', 0x30)
	If IsObj($colItems) Then
		For $objItem In $colItems
			$x += 1
			ReDim $aReturn[$x + 1][9]
			$aReturn[$x][0] = $objItem.Name
			$aReturn[$x][1] = $objItem.Description
			If $objItem.Description = 'Netzwerkverbindung' Then
				$aReturn[$x][2] = $objItem.ProviderName
			Else
				$aReturn[$x][2] = '---'
			EndIf
			If String($objItem.FileSystem) <> '' Then
				If String($objItem.Access) <> '' Then
					$aReturn[$x][3] = $aAccess[Number($objItem.Access)]
				Else
					$aReturn[$x][3] = 'nicht verfügbar'
				EndIf
				$aReturn[$x][4] = _ByteAutoSize($objItem.Size)
				$aReturn[$x][5] = _ByteAutoSize($objItem.FreeSpace)
				$aReturn[$x][6] = $objItem.FileSystem
				$aReturn[$x][7] = '"' & $objItem.VolumeName & '"'
				$aReturn[$x][8] = $objItem.VolumeSerialNumber
			EndIf
		Next
	EndIf
	Return $aReturn
EndFunc   ;==>_CI_GetLogicalDisk

Func _CI_GetHarddrives($strComputer = '.')
	Local $aReturn[1][8] = [[ _
			'Bezeichnung:', 'Größe:', 'Anschluss:', 'Bytes/Sektor:', 'Anzahl der Sektoren:', _
			'PNPDeviceID:', 'Status:', 'Seriennr. (Hardware):']]
	Local $x = 0, $objWMIService, $colItems
	$objWMIService = ObjGet('winmgmts:\\' & $strComputer & '\root\cimv2')
	If Not IsObj($objWMIService) Then Return SetError(1, 0, 0)
	$colItems = $objWMIService.ExecQuery('SELECT * FROM Win32_DiskDrive', 'WQL', 0x30)
	If IsObj($colItems) Then
		For $objItem In $colItems
			$x += 1
			ReDim $aReturn[$x + 1][8]
			$aReturn[$x][0] = $objItem.Model
			$aReturn[$x][1] = _ByteAutoSize($objItem.Size)
			$aReturn[$x][2] = $objItem.InterfaceType
			$aReturn[$x][3] = $objItem.BytesPerSector
			$aReturn[$x][4] = $objItem.TotalSectors
			$aReturn[$x][5] = $objItem.PNPDeviceID
			$aReturn[$x][6] = $objItem.Status
			Switch @OSVersion
				Case 'WIN_VISTA', 'WIN_7'
					If Number($objItem.SerialNumber) > 0 Then
						$aReturn[$x][7] = $objItem.SerialNumber & '   ("' & _CI_SerialToString($objItem.SerialNumber) & '")'
					Else
						$aReturn[$x][7] = 'nicht vorhanden'
					EndIf
				Case Else
					$aReturn[$x][7] = 'Wird von ' & @OSVersion & ' nicht unterstützt!'
			EndSwitch
		Next
	EndIf
	Return $aReturn
EndFunc   ;==>_CI_GetHarddrives

Func _CI_SerialToString($sSerial)
	Local $sOut = ''
	For $i = 1 To StringLen($sSerial) Step 2
		$sOut &= Chr(Dec(StringMid($sSerial, $i, 2)))
	Next
	Return $sOut
EndFunc   ;==>_CI_SerialToString

Func _CI_GetCDROM($strComputer = '.')
	Local $aReturn[1][9] = [[ _
			'Laufwerk:', 'Bezeichnung:', 'Typ:', 'PNPDeviceID:', 'Laufwerk-Status:', _
			'Disc-Status:', 'Disc-Name:', 'Disc-Größe:', 'Seriennr. (Disc):']]
	Local $x = 0, $objWMIService, $colItems, $aMedia[2] = ['keine Disc eingelegt', 'Disc eingelegt']
	$objWMIService = ObjGet('winmgmts:\\' & $strComputer & '\root\cimv2')
	If Not IsObj($objWMIService) Then Return SetError(1, 0, 0)
	$colItems = $objWMIService.ExecQuery('SELECT * FROM Win32_CDROMDrive', 'WQL', 0x30)
	If IsObj($colItems) Then
		For $objItem In $colItems
			$x += 1
			ReDim $aReturn[$x + 1][9]
			$aReturn[$x][0] = $objItem.Drive
			$aReturn[$x][1] = $objItem.Name
			$aReturn[$x][2] = $objItem.MediaType
			$aReturn[$x][3] = $objItem.PNPDeviceID
			$aReturn[$x][4] = $objItem.Status
			$aReturn[$x][5] = $aMedia[Abs($objItem.MediaLoaded)]
			If Abs($objItem.MediaLoaded) Then
				$aReturn[$x][6] = '"' & $objItem.VolumeName & '"'
				$aReturn[$x][7] = _ByteAutoSize($objItem.Size)
				$aReturn[$x][8] = $objItem.VolumeSerialNumber
			EndIf
		Next
	EndIf
	Return $aReturn
EndFunc   ;==>_CI_GetCDROM

Func _CI_GetNetwork($strComputer = '.')
	Local $aReturn[2][10] = [[ _
			'Benutzername:', 'Computername:', 'LAN-IP-Adresse:', 'DNS-Server:', 'Arbeitsgruppe:', _
			'WAN-IP-Adresse:', 'Ping-Zeiten:', '     google.de', '     heise.de', '     t-online.de']]
	Local $x = 0, $objWMIService, $colItems
	$objWMIService = ObjGet('winmgmts:\\' & $strComputer & '\root\cimv2')
	If Not IsObj($objWMIService) Then Return SetError(1, 0, 0)
	$aReturn[1][0] = @UserName
	$aReturn[1][1] = @ComputerName
	$aReturn[1][2] = _CI_GetLANIP()
	$aReturn[1][3] = _CI_GetDNS()
	$colItems = $objWMIService.ExecQuery('SELECT * FROM Win32_ComputerSystem', 'WQL', 0x30)
	If IsObj($colItems) Then
		For $objItem In $colItems
			$aReturn[1][4] = $objItem.Domain
			$aReturn[1][5] = _GetIP()
		Next
	EndIf
	$aReturn[1][7] = _CI_PingCheck('google.de')
	$aReturn[1][8] = _CI_PingCheck('heise.de')
	$aReturn[1][9] = _CI_PingCheck('t-online.de')
	Return $aReturn
EndFunc   ;==>_CI_GetNetwork

Func _CI_GetLANIP()
	Local $sPID = Run(@ComSpec & " /c ping -4 -n 1 " & @ComputerName, @SystemDir, @SW_HIDE, $STDOUT_CHILD)
	Local $sOut = ''
	While 1
		$sOut &= StdoutRead($sPID)
		If @error Then ExitLoop
	WEnd
	Return StringRegExpReplace($sOut, '(?s).+\[(.+)\].+', '$1')
EndFunc   ;==>_CI_GetLANIP

Func _CI_GetDNS()
	Local $sPID = Run(@ComSpec & " /c nslookup " & @ComputerName, @SystemDir, @SW_HIDE, $STDOUT_CHILD)
	Local $sOut = ''
	While 1
		$sOut &= StdoutRead($sPID)
		If @error Then ExitLoop
	WEnd
	Return StringRegExpReplace($sOut, '(?s)Server:\h+(\S+).*?Address:\h+(\S+).*', '$2  ("$1")')
EndFunc   ;==>_CI_GetDNS

Func _CI_PingCheck($sURL)
	Local $iRet, $aError[5] = ['', 'Computer ist offline', 'Computer ist nicht erreichbar', 'Falsche Adresse', 'Anderer Fehler']
	$iRet = Ping($sURL, 1000)
	If Not @error Then Return '~ ' & $iRet & ' ms'
	Return $aError[@error]
EndFunc   ;==>_CI_PingCheck

Func _CI_GetNetworkAdapter($strComputer = '.')
	Local $aReturn[1][12] = [[ _
			'Hersteller:', 'Name:', 'Adapter-Typ:', 'Kennung:', _
			'MAC-Adresse:', 'IP-Adresse:', 'IP-Subnetzmaske:', 'Adresstyp:', _
			'DHCP-Server:', 'IP erhalten:', 'IP läuft ab:', 'Standardgateway:']]
	Local $x = 0, $objWMIService, $colItems, $colItems2
	$objWMIService = ObjGet('winmgmts:\\' & $strComputer & '\root\cimv2')
	If Not IsObj($objWMIService) Then Return SetError(1, 0, 0)
	$colItems = $objWMIService.ExecQuery('SELECT * FROM Win32_NetworkAdapter WHERE Netconnectionstatus > 0', 'WQL', 0x30)
	If Not IsObj($colItems) Then Return SetError(2, 0, 0)
	For $objItem In $colItems
		$x += 1
		ReDim $aReturn[$x + 1][12]
		$aReturn[$x][0] = $objItem.Manufacturer
		$aReturn[$x][1] = $objItem.Name
		$aReturn[$x][2] = $objItem.AdapterType
		$aReturn[$x][3] = $objItem.NetConnectionID
		$aReturn[$x][4] = $objItem.MACAddress
		$colItems2 = $objWMIService.ExecQuery('SELECT * FROM Win32_NetworkAdapterConfiguration', 'WQL', 0x30)
		If IsObj($colItems2) Then
			For $objItem2 In $colItems2
				If $objItem.Caption = $objItem2.Caption Then
					If $objItem2.IPEnabled = -1 Then
						$aReturn[$x][5] = $objItem2.IPAddress(0)
						$aReturn[$x][6] = $objItem2.IPSubnet(0)
						If $objItem2.DHCPEnabled = -1 Then
							$aReturn[$x][7] = 'von DHCP zugewiesen'
							$aReturn[$x][8] = $objItem2.DHCPServer
							$aReturn[$x][9] = _WMIDateStringToDate($objItem2.DHCPLeaseObtained)
							$aReturn[$x][10] = _WMIDateStringToDate($objItem2.DHCPLeaseExpires)
						Else
							$aReturn[$x][7] = 'Manuell konfiguriert'
						EndIf
						$aReturn[$x][11] = $objItem2.DefaultIPGateway(0)
					EndIf
				EndIf
			Next
		EndIf
	Next
	Return $aReturn
EndFunc   ;==>_CI_GetNetworkAdapter

Func _CI_GetCPU($strComputer = '.')
	Local $aReturn[2][12] = [[ _
			'Prozessor:', 'Name:', 'Beschreibung:', 'Sockel:', 'Taktfrequenz:', 'Ext. Taktfrequenz:', 'Spannung:', _
			'Adress-Bitbreite:', 'Daten-Bitbreite:', 'Prozessor-ID:', '', '']]
	Local $x = 0, $objWMIService, $colItems
	$objWMIService = ObjGet('winmgmts:\\' & $strComputer & '\root\cimv2')
	If Not IsObj($objWMIService) Then Return SetError(1, 0, 0)
	$colItems = $objWMIService.ExecQuery('SELECT * FROM Win32_Processor', 'WQL', 0x30)
	If IsObj($colItems) Then
		For $objItem In $colItems
			$x += 1
			ReDim $aReturn[$x + 1][12]
			$aReturn[$x][0] = $objItem.DeviceID
			$aReturn[$x][1] = $objItem.Name
			$aReturn[$x][2] = $objItem.Description
			$aReturn[$x][3] = $objItem.SocketDesignation
			$aReturn[$x][4] = $objItem.CurrentClockSpeed & ' MHz   (max. ' & $objItem.MaxClockSpeed & ' MHz)'
			$aReturn[$x][5] = $objItem.ExtClock & ' MHz'
			$aReturn[$x][6] = Round($objItem.CurrentVoltage / 10, 1) & ' V'
			$aReturn[$x][7] = $objItem.AddressWidth & ' Bit'
			$aReturn[$x][8] = $objItem.DataWidth & ' Bit'
			$aReturn[$x][9] = $objItem.ProcessorId
			Switch @OSVersion
				Case 'WIN_VISTA', 'WIN_7'
					$aReturn[0][10] = 'Prozessorkerne:'
					$aReturn[0][11] = 'logische Prozessoren:'
					$aReturn[$x][10] = $objItem.NumberOfCores
					$aReturn[$x][11] = $objItem.NumberOfLogicalProcessors
			EndSwitch
		Next
	EndIf
	Return $aReturn
EndFunc   ;==>_CI_GetCPU

Func _CI_GetRAM($strComputer = '.')
	Local $aMemType[22] = ['Unbekannt', 'Anderes', 'DRAM', 'Sync DRAM', 'Cache DRAM', _
			'EDO', 'EDRAM', 'VRAM', 'SRAM', 'RAM', 'ROM', _
			'Flash', 'EEPROM', 'FEPROM', 'EPROM', 'CDRAM', '3DRAM', _
			'SDRAM', 'SGRAM', 'RDRAM', 'DDR', 'DDR-2']
	Local $aFormFactor[24] = ['Unbekannt', 'Andere', 'SIP', 'DIP', 'ZIP', 'SOJ', _
			'Proprietär', 'SIMM', 'DIMM', 'TSOP', 'PGA', 'RIMM', _
			'SODIMM', 'SRIMM', 'SMD', 'SSMP', 'QFP', 'TQFP', _
			'SOIC', 'LCC', 'PLCC', 'BGA', 'FPBGA', 'LGA']
	Local $aErrCorr[8] = ['Reserviert', 'Andere', 'Unbekannt', 'Keine', 'Parity', 'Single-bit ECC', 'Multi-bit ECC', 'CRC']
	Local $aReturn[2][8] = [[ _
			'Belegung:', 'Kapazität:', 'Daten-Bitbreite:', 'Steckplatz:', _
			'Typ:', 'Format:', 'Fehlerkorrektur:', 'Bezeichnung:']]
	Local $x = 0, $objWMIService, $colItems, $iMemDev, $iMaxCap, $iErrCorr
	$objWMIService = ObjGet('winmgmts:\\' & $strComputer & '\root\cimv2')
	If Not IsObj($objWMIService) Then Return SetError(1, 0, 0)
	$colItems = $objWMIService.ExecQuery('SELECT * FROM Win32_PhysicalMemoryArray', 'WQL', 0x30)
	If IsObj($colItems) Then
		For $objItem In $colItems
			$iMemDev = $objItem.MemoryDevices
			$iMaxCap = _ByteAutoSize($objItem.MaxCapacity * 1024, 0, 3)
			$iErrCorr = Number($objItem.MemoryErrorCorrection)
		Next
	EndIf
	$colItems = $objWMIService.ExecQuery('SELECT * FROM Win32_PhysicalMemory', 'WQL', 0x30)
	If IsObj($colItems) Then
		For $objItem In $colItems
			$x += 1
			ReDim $aReturn[$x + 1][8]
			$aReturn[$x][0] = $objItem.BankLabel
			$aReturn[$x][1] = _ByteAutoSize($objItem.Capacity, 0, 3) & '   (max. ' & $iMaxCap & ')'
			$aReturn[$x][2] = $objItem.TotalWidth & ' Bit'
			$aReturn[$x][3] = $objItem.DeviceLocator & '   (max. ' & $iMemDev & ' Steckplätze)'
			$aReturn[$x][4] = $aMemType[Number($objItem.MemoryType)]
			$aReturn[$x][5] = $aFormFactor[Number($objItem.FormFactor)]
			$aReturn[$x][6] = $aErrCorr[$iErrCorr]
			$aReturn[$x][7] = $objItem.PartNumber
		Next
	EndIf
	Return $aReturn
EndFunc   ;==>_CI_GetRAM

Func _CI_GetVideoController($strComputer = '.')
	Local $aReturn[2][12] = [[ _
			'Hersteller:', 'Beschreibung:', 'RAMDAC:', 'Grafikkarten-RAM:', _
			'RAM-Typ:', 'Horiz.  Auflösung:', 'Vertik. Auflösung:', 'Bits/Pixel:', _
			'Anzahl der Farben:', 'Bildwiederholfrequenz:', 'Treiberversion:', 'Treiberdatum:']]
	Local $aRAMType[14] = ['', 'Anderer', 'Unbekannt', 'VRAM', 'DRAM', 'SRAM', 'WRAM', 'EDO RAM', _
			'Burst Sync DRAM', 'Pipelined Burst SRAM', 'CDRAM', '3DRAM', 'SDRAM', 'SGRAM']
	Local $x = 0, $objWMIService, $colItems, $Output
	$objWMIService = ObjGet('winmgmts:\\' & $strComputer & '\root\cimv2')
	If Not IsObj($objWMIService) Then Return SetError(1, 0, 0)
	$colItems = $objWMIService.ExecQuery('SELECT * FROM Win32_VideoController', 'WQL', 0x30)
	If IsObj($colItems) Then
		For $objItem In $colItems
			$x += 1
			ReDim $aReturn[$x + 1][12]
			$aReturn[$x][0] = $objItem.AdapterCompatibility
			$aReturn[$x][1] = $objItem.Description
			$aReturn[$x][2] = $objItem.AdapterDACType
			$aReturn[$x][3] = _ByteAutoSize($objItem.AdapterRAM, 0, 3)
			$aReturn[$x][4] = $aRAMType[Number($objItem.VideoMemoryType)]
			$aReturn[$x][5] = $objItem.CurrentHorizontalResolution
			$aReturn[$x][6] = $objItem.CurrentVerticalResolution
			$aReturn[$x][7] = $objItem.CurrentBitsPerPixel
			$aReturn[$x][8] = _StringAddThousandsSep($objItem.CurrentNumberOfColors, '.', ',')
			$aReturn[$x][9] = $objItem.CurrentRefreshRate & ' Hz'
			$aReturn[$x][10] = $objItem.DriverVersion
			$aReturn[$x][11] = _WMIDateStringToDate($objItem.DriverDate)
		Next
	EndIf
	Return $aReturn
EndFunc   ;==>_CI_GetVideoController

Func _CI_GetMonitor($strComputer = '.')
	Local $aReturn[2][8] = [[ _
			'Hersteller:', 'Modell:', 'Breite (Pixel):', 'Höhe (Pixel):', _
			'Pixel pro Inch (X):', 'Pixel pro Inch (Y):', 'Monitorgröße (ca.):', 'PNPDeviceID:']]
	Local $x = 0, $objWMIService, $colItems, $Output
	$objWMIService = ObjGet('winmgmts:\\' & $strComputer & '\root\cimv2')
	If Not IsObj($objWMIService) Then Return SetError(1, 0, 0)
	$colItems = $objWMIService.ExecQuery('SELECT * FROM Win32_DesktopMonitor', 'WQL', 0x30)
	If IsObj($colItems) Then
		For $objItem In $colItems
			$x += 1
			ReDim $aReturn[$x + 1][8]
			$aReturn[$x][0] = $objItem.MonitorManufacturer
			$aReturn[$x][1] = $objItem.Name
			$aReturn[$x][2] = $objItem.ScreenWidth
			$aReturn[$x][3] = $objItem.ScreenHeight
			$aReturn[$x][4] = $objItem.PixelsPerXLogicalInch
			$aReturn[$x][5] = $objItem.PixelsPerYLogicalInch
			$aReturn[$x][6] = Round($objItem.ScreenWidth / ($objItem.PixelsPerXLogicalInch / 2.54), 2) & _
					' x ' & Round($objItem.ScreenHeight / ($objItem.PixelsPerYLogicalInch / 2.54), 2) & ' cm²'
			$aReturn[$x][7] = $objItem.PNPDeviceID
		Next
	EndIf
	Return $aReturn
EndFunc   ;==>_CI_GetMonitor

Func _CI_GetPrinter($strComputer = '.')
	Local $aReturn[2][5] = [['Name:', 'Treibername:', 'Anschluss:', 'Horiz.  Auflösung:', 'Vertik. Auflösung:']]
	Local $x = 0, $objWMIService, $colItems
	$objWMIService = ObjGet('winmgmts:\\' & $strComputer & '\root\cimv2')
	If Not IsObj($objWMIService) Then Return SetError(1, 0, 0)
	$colItems = $objWMIService.ExecQuery('SELECT * FROM Win32_Printer', 'WQL', 0x30)
	If IsObj($colItems) Then
		For $objItem In $colItems
			$x += 1
			ReDim $aReturn[$x + 1][5]
			$aReturn[$x][0] = $objItem.Name
			$aReturn[$x][1] = $objItem.DriverName
			$aReturn[$x][2] = $objItem.PortName
			$aReturn[$x][3] = $objItem.HorizontalResolution
			$aReturn[$x][4] = $objItem.VerticalResolution
		Next
	EndIf
	Return $aReturn
EndFunc   ;==>_CI_GetPrinter

Func _CI_GetSoundDevice($strComputer = '.')
	Local $aReturn[2][3] = [['Hersteller:', 'Name:', 'PNPDeviceID:']]
	Local $x = 0, $objWMIService, $colItems
	$objWMIService = ObjGet('winmgmts:\\' & $strComputer & '\root\cimv2')
	If Not IsObj($objWMIService) Then Return SetError(1, 0, 0)
	$colItems = $objWMIService.ExecQuery('SELECT * FROM Win32_SoundDevice', 'WQL', 0x30)
	If IsObj($colItems) Then
		For $objItem In $colItems
			$x += 1
			ReDim $aReturn[$x + 1][3]
			$aReturn[$x][0] = $objItem.Manufacturer
			$aReturn[$x][1] = $objItem.Name
			$aReturn[$x][2] = $objItem.PNPDeviceID
		Next
	EndIf
	Return $aReturn
EndFunc   ;==>_CI_GetSoundDevice

Func _CI_GetMainBoard($strComputer = '.')
	Local $aReturn[2][12] = [[ _
			'Hersteller:', 'Produkt:', 'Version:', 'Seriennummer:', 'Ext. Anschlüsse:', _
			'Int. Anschlüsse:', '', 'BIOS-Hersteller:', 'Name:', 'Version:', 'Datum:', 'Seriennummer:']]
	Local $x = 1, $objWMIService, $colItems, $sExtConnector = '', $sIntConnector = '', $sTmp
	$objWMIService = ObjGet('winmgmts:\\' & $strComputer & '\root\cimv2')
	If Not IsObj($objWMIService) Then Return SetError(1, 0, 0)
	$colItems = $objWMIService.ExecQuery('SELECT * FROM Win32_PortConnector', 'WQL', 0x30)
	If IsObj($colItems) Then
		For $objItem In $colItems
			$sTmp = $objItem.ExternalReferenceDesignator
			If StringLen($sTmp) > 1 Then
				$sExtConnector &= $sTmp & ' ** '
				ContinueLoop
			EndIf
			$sTmp = $objItem.InternalReferenceDesignator
			If StringLen($sTmp) > 1 Then $sIntConnector &= $sTmp & ' ** '
		Next
	EndIf
	$sExtConnector = StringTrimRight($sExtConnector, 4)
	$sIntConnector = StringTrimRight($sIntConnector, 4)
	$colItems = $objWMIService.ExecQuery('SELECT * FROM Win32_BaseBoard', 'WQL', 0x30)
	If IsObj($colItems) Then
		For $objItem In $colItems
			$aReturn[$x][0] = $objItem.Manufacturer
			$aReturn[$x][1] = $objItem.Product
			$aReturn[$x][2] = $objItem.Version
			$aReturn[$x][3] = $objItem.SerialNumber
			$aReturn[$x][4] = $sExtConnector
			$aReturn[$x][5] = $sIntConnector
		Next
	EndIf
	$colItems = $objWMIService.ExecQuery('SELECT * FROM Win32_BIOS', 'WQL', 0x30)
	If IsObj($colItems) Then
		For $objItem In $colItems
			$aReturn[$x][7] = $objItem.Manufacturer
			$aReturn[$x][8] = $objItem.Name
			$aReturn[$x][9] = $objItem.BIOSVersion(0)
			$aReturn[$x][10] = _WMIDateStringToDate($objItem.ReleaseDate)
			$aReturn[$x][11] = $objItem.SerialNumber
		Next
	EndIf
	Return $aReturn
EndFunc   ;==>_CI_GetMainBoard

Func _CI_GetSystemSlot($strComputer = '.')
	Local $aReturn[2][3] = [['Bezeichnung:', 'Steckplatz belegt:', 'max. Datenbreite:']]
	Local $aUsage[5] = ['Reserviert', 'Anderer', 'Unbekannt', 'Nein', 'Ja']
	Local $x = 0, $objWMIService, $colItems
	$objWMIService = ObjGet('winmgmts:\\' & $strComputer & '\root\cimv2')
	If Not IsObj($objWMIService) Then Return SetError(1, 0, 0)
	$colItems = $objWMIService.ExecQuery('SELECT * FROM Win32_SystemSlot', 'WQL', 0x30)
	If IsObj($colItems) Then
		For $objItem In $colItems
			$x += 1
			ReDim $aReturn[$x + 1][3]
			$aReturn[$x][0] = $objItem.SlotDesignation
			$aReturn[$x][1] = $aUsage[$objItem.CurrentUsage]
			$aReturn[$x][2] = 2 ^ ($objItem.MaxDataWidth + 3) & ' Bits'
		Next
	EndIf
	Return $aReturn
EndFunc   ;==>_CI_GetSystemSlot

Func _CI_GetProgInfo()
	Local $aReturn[2][8] = [['Programmname:', 'Version:', 'Datum:', 'Programmierer:', '', 'Danksagung:']]
	$aReturn[1][0] = 'Computer-Info'
	$aReturn[1][1] = '2.0.0.0'
	$aReturn[1][2] = '17.12.2009'
	$aReturn[1][3] = 'Oscar (www.autoit.de)'
	$aReturn[1][5] = 'An "Thorsten Meger" (Xenobiologist) für die Funktion "_DecodeProductKey"'
	$aReturn[1][6] = 'An "Prog@ndy" für den Dll-Aufruf zum auslesen von "GetLocaleInfo"'
	$aReturn[1][7] = 'An alle, die dieses Programm testeten und BugReports/Verbesserungsvorschläge/Kritik beisteuerten'
	Return $aReturn
EndFunc   ;==>_CI_GetProgInfo

Func _WMIDateStringToDate($dtmDate)
	Return (StringLeft($dtmDate, 4) & '/' & StringMid($dtmDate, 5, 2) & '/' & StringMid($dtmDate, 7, 2) _
			 & ' ' & StringMid($dtmDate, 9, 2) & ':' & StringMid($dtmDate, 11, 2) & ':' & StringMid($dtmDate, 13, 2))
EndFunc   ;==>_WMIDateStringToDate

Func WM_SIZE($hWnd, $iMsg, $iwParam, $ilParam)
	_GUICtrlStatusBar_Resize($hStatus)
	Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_SIZE

Func MY_WM_GETMINMAXINFO($hWnd, $Msg, $wParam, $lParam)
	Local $minmaxinfo
	If $hWnd = $hGUI Then
		$minmaxinfo = DllStructCreate('int;int;int;int;int;int;int;int;int;int', $lParam)
		DllStructSetData($minmaxinfo, 7, 600)
		DllStructSetData($minmaxinfo, 8, 400)
	EndIf
EndFunc   ;==>MY_WM_GETMINMAXINFO

;===============================================================================
; Function Name:   _ByteAutoSize($iSize[, $iRound][, $iFormat][, $bThousands])
; Description::    Gibt einen Bytewert in einer bestimmten Einheit zurück
; Parameter(s):    $iSize = Größe in Byte übergeben
;                  $iRound = Anzahl der Nachkommastellen (0...8)
;                  $iFormat = bestimmt den Rückgabewert
;                     0 = Automatisch (je nach übergebenen Wert)
;                     1 = in Byte
;                     2 = in KByte
;                     3 = in MByte
;                     4 = in GByte
;                  $bThousands = Rückgabe mit Tausendertrennzeichen (True/False)
; Requirement(s):  #include <String.au3>
; Author(s):       Oscar (www.autoit.de)
;===============================================================================
Func _ByteAutoSize($iSize, $iRound = 2, $iFormat = 0, $bThousands = True)
	Local $aSize[4] = [' Byte', ' KByte', ' MByte', ' GByte'], $sReturn
	If $iFormat < 0 Or $iFormat > 4 Then $iFormat = 0
	If $iRound < 0 Or $iRound > 8 Then $iRound = 2
	If Not IsBool($bThousands) Then $bThousands = False
	$iSize = Abs($iSize)
	If $iFormat = 0 Then
		For $i = 30 To 0 Step -10
			If $iSize > (2 ^ $i) Then
				$iFormat = $i / 10 + 1
				ExitLoop
			EndIf
		Next
	EndIf
	If $iFormat = 0 Then $iFormat = 1
	$sReturn = StringFormat('%.' & $iRound & 'f', Round($iSize / (2 ^ (($iFormat - 1) * 10)), $iRound))
	If $bThousands Then $sReturn = _StringAddThousandsSep($sReturn, '.', ',')
	Return $sReturn & $aSize[$iFormat - 1]
EndFunc   ;==>_ByteAutoSize

; #FUNCTION# ====================================================================================================================
; Name...........: _StringAddThousandsSep
; Description ...: Returns the original numbered string with the Thousands delimiter inserted.
; Syntax.........: _StringAddThousandsSep($sString[, $sThousands = -1[, $sDecimal = -1]])
; Parameters ....: $sString    - The string to be converted.
;                  $sThousands - Optional: The Thousands delimiter
;                  $sDecimal   - Optional: The decimal delimiter
; Return values .: Success - The string with Thousands delimiter added.
; Author ........: SmOke_N (orignal _StringAddComma
; Modified.......: Valik (complete re-write, new function name)
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......; Yes
; ===============================================================================================================================
Func _StringAddThousandsSep($sString, $sThousands = -1, $sDecimal = -1)
	Local $sResult = "" ; Force string
	Local $rKey = "HKCU\Control Panel\International"
	If $sDecimal = -1 Then $sDecimal = RegRead($rKey, "sDecimal")
	If $sThousands = -1 Then $sThousands = RegRead($rKey, "sThousand")
	Local $aNumber = StringRegExp($sString, "(\D?\d+)\D?(\d*)", 1) ; This one works for negatives.
	If UBound($aNumber) = 2 Then
		Local $sLeft = $aNumber[0]
		While StringLen($sLeft)
			$sResult = $sThousands & StringRight($sLeft, 3) & $sResult
			$sLeft = StringTrimRight($sLeft, 3)
		WEnd
		$sResult = StringTrimLeft($sResult, StringLen($sThousands)) ; Strip leading thousands separator
		If $aNumber[1] <> "" Then $sResult &= $sDecimal & $aNumber[1]
	EndIf
	Return $sResult
EndFunc   ;==>_StringAddThousandsSep

; ----------------------------------------------------------------------------
; AutoIt Version: 3.1.1 beta
; Author:         Unknown & Thorsten Meger <[email protected]>
;
; Script Function: Decode REG_BINARY
; ----------------------------------------------------------------------------
Func _DecodeProductKey($BinaryDPID)
	If IsBinary($BinaryDPID) Then $BinaryDPID = StringMid($BinaryDPID, 3) ; Changed because Beta 3.2.13.2
	Local $bKey[15]
	Local $sKey[29]
	Local $Digits[24]
	Local $Value = 0
	Local $hi = 0
	Local $n = 0
	Local $i = 0
	Local $dlen = 29
	Local $slen = 15
	Local $Result
	$Digits = StringSplit('BCDFGHJKMPQRTVWXY2346789', '')
	$BinaryDPID = StringMid($BinaryDPID, 105, 30)
	For $i = 1 To 29 Step 2
		$bKey[Int($i / 2)] = Dec(StringMid($BinaryDPID, $i, 2))
	Next
	For $i = $dlen - 1 To 0 Step -1
		If Mod(($i + 1), 6) = 0 Then
			$sKey[$i] = '-'
		Else
			$hi = 0
			For $n = $slen - 1 To 0 Step -1
				$Value = BitOR(BitShift($hi, -8), $bKey[$n])
				$bKey[$n] = Int($Value / 24)
				$hi = Mod($Value, 24)
			Next
			$sKey[$i] = $Digits[$hi + 1]
		EndIf
	Next
	For $i = 0 To 28
		$Result = $Result & $sKey[$i]
	Next
	Return $Result
EndFunc   ;==>_DecodeProductKey
algunas palabras q no entiendan es en alemán
Salu22:)
Jonny
Profesional del Autoit
Mensajes: 1042
Registrado: 30 Jun 2008, 20:08

Re: Sobre CompInfo

Mensaje por Jonny »

Uuuau.

Va a ser más difícil entender la interfaz que el código, aunque el nombre de las variables y eso no ayude mucho, precisamente... :).

me lo parece, o no devuelve el número de serie de los discos duros?...

Como ni "papa" de alemán, pues no se casi la info de qué, estoy leyendo :).

Lo que no veo (o creo) es la info de la batería ¿puede ser?.

Está muy bien, por lo menos para coger algunas cosas que me gustan, que con la UDF que decía más arriba no se obtienen.

¡Acias!.

Salu2!
Avatar de Usuario
BasicOs
Site Admin
Mensajes: 2085
Registrado: 21 Nov 2006, 19:24
Ubicación: El Internet - (Canarias, España)
Contactar:

Re: Sobre CompInfo

Mensaje por BasicOs »

Puedes ir traduciendo con el traductor de google algunas palabras, como Festplatten son discos duros ;) :smt026
Batería no lo encuentro así de repente pero puede estar.
Salu22:)
Jonny
Profesional del Autoit
Mensajes: 1042
Registrado: 30 Jun 2008, 20:08

Re: Sobre CompInfo

Mensaje por Jonny »

Yo no es por entender lo que pone :), pero así mirando lo que sale en el programilla (los valores de cada propiedad de cada componente) no veo que salga la batería, aunque puede servir la función que tiene la UDF CompInfo para eso. De todas formas, yo me he hecho una función muy parecida, pero con algo más de info que en esa función no hay, y un poco más de control de errores. La idea es hacer una librería, con todas las funciones...

A ver que sale, y la cuelgo cuando la tenga lista.

Lo que no se, es como obtener la temperatura o refrigeración del equipo, como hace Everest. Entre las clases WMI, he visto alguna para ello, pero no funcionan...

Salu2!
Jonny
Profesional del Autoit
Mensajes: 1042
Registrado: 30 Jun 2008, 20:08

Re: Sobre CompInfo

Mensaje por Jonny »

Confirmado :).

Everest detecta el hardware con drivers, pero no con los que haya instalados en el equipo, sino con unos suyos propios.
O, almenos eso vi ayer cacharreando con WMI...

Así, que va a ser muy difícil hacer algunas de las cosas que hace ese soft, como lo de las temperaturas (porque lo demás más o menos sí se puede hacer con WMI, aunque no exactamente igual).

Vi ayer en el foro inglés un código C++ que decían que devolvía la temperatura de la CPU, pero no se como se usará eso con AutoIt, no lo ponían, y tampoco se si se podría, porque habían clases en el código...

Salu2!
Responder