Что нового

Аналог System Information

madmasles

Модератор
Глобальный модератор
Сообщения
7,790
Репутация
2,322
inververs [?]
Странный конечно у вас способ поиска.
smiley.gif
Первым всегда будет находится hal.dll, но это не факт что система использует именно его, это только показывает, что файл такой есть.
Мне кажется, что msinfo32.exe выдает только информацию о версии файла, какой конкретно файл используется, ИМХО, это другой вопрос. А все версии файлов hal*.dll (у меня) одинаковые. В принципе, это можно проверить.
Код:
ConsoleWrite('Hal Version: ' & @LF & _Get_Hal_Version_All() & @LF)
ConsoleWrite('---' & @LF)
ConsoleWrite('Hal Version WMI: ' & @LF & _Get_Hal_VersionWMI_All() & @LF)

Func _Get_Hal_VersionWMI_All()
	Local $o_WMI, $o_Items, $o_Tmp, $s_Version
	$o_WMI = ObjGet('winmgmts:\\localhost\root\CIMV2')
	If @error Then Return SetError(-1, 0, -1)
	$o_Items = $o_WMI.ExecQuery('SELECT Version,FileName FROM CIM_DataFile WHERE Drive="C:" AND Path="\\Windows\\System32\\" AND FileName Like "hal%" AND Extension="dll"', 'WQL', 0x30)
	If Not IsObj($o_Items) Then Return 'Not available'
	For $o_Tmp In $o_Items
		$s_Version &= Execute('StringFormat("%-15s%-15s\n", $o_Tmp.FileName & ".dll", $o_Tmp.Version)')
	Next
	Return $s_Version
EndFunc   ;==>_Get_Hal_VersionWMI

Func _Get_Hal_Version_All()
	Local $h_Search, $s_File, $s_Version

	$h_Search = FileFindFirstFile(@SystemDir & '\hal*.dll')
	If $h_Search = -1 Then Return 'Not available'
	While 1
		$s_File = FileFindNextFile($h_Search)
		If @error Then ExitLoop
		$s_Version &= StringFormat('%-15s%-15s\n', $s_File, FileGetVersion(@SystemDir & '\' & $s_File))
	WEnd
	FileClose($h_Search)
	Return $s_Version
EndFunc   ;==>_Get_Hal_Version
 

ivsatel

Продвинутый
Сообщения
319
Репутация
84
Моя попытка:
Код:
#include <FileOperations.au3>

Opt("MustDeclareVars", 1)

Global $ValidFile, $i_Lang

Local $objWMIService, $Instance, $CIM

Local $aOS[30] = ['', '$Instances.Caption', '$Instances.Version', '$Instances.CSDVersion', '$Instances.BuildNumber', '$Instances.Manufacturer', _
		'$Instances.CSName', '$Instances.Vendor', '$Instances.Name', '$Instances.SystemType', '$Instances.Caption', '$Instances.Manufacturer', _
		'$Instances.Manufacturer', '$Instances.SMBIOSBIOSVersion', '$Instances.ReleaseDate', '$Instances.SMBIOSMajorVersion', '$Instances.SMBIOSMinorVersion', _
		'$Instances.WindowsDirectory', '$Instances.SystemDirectory', '$Instances.BootDevice', '$Instances.OSLanguage', '', _
		'$Instances.UserName', '$Instances.DaylightName', '$Instances.TotalPhysicalMemory', '$Instances.FreePhysicalMemory', _
		'$Instances.TotalVirtualMemorySize', '$Instances.TotalVirtualMemory', '$Instances.AvailableVirtualMemory', '$Instances.Name']

Local $aOSText[30] = ['', 'Имя ОС ', 'Версия ', '', 'Сборка ', 'Изготовитель ОС ', 'Имя системы ', 'Изготовитель ', 'Модель ', 'Тип ', 'Процессор ', '', _
		'Версия BIOS ', '', '', 'Версия SMBIOS ', '.', 'Папка Windows ', 'Системная папка ', 'Устройство загрузки ', 'Язык ', 'Аппаратно зависимый уровень HAL ', _
		'Имя пользователя ', 'Часовой пояс ', 'Полный объем физической памяти ', 'Доступно физической памяти ', 'Всего виртуальной памяти ', _
		'Доступно виртуальной памяти ', 'Файл подкачки ', 'Файл подкачки ']

Local $aWIN32[30] = ['', 'Win32_OperatingSystem', 'Win32_OperatingSystem', 'Win32_OperatingSystem', 'Win32_OperatingSystem', 'Win32_OperatingSystem', _
		'Win32_OperatingSystem', 'Win32_ComputerSystemProduct', 'Win32_ComputerSystemProduct', 'Win32_ComputerSystem', 'Win32_Processor', 'Win32_Processor', _
		'Win32_BIOS', 'Win32_BIOS', 'Win32_BIOS', 'Win32_BIOS', 'Win32_BIOS', 'Win32_OperatingSystem', 'Win32_OperatingSystem', 'Win32_OperatingSystem', _
		'Win32_OperatingSystem', 'Win32_OperatingSystem', 'Win32_ComputerSystem', 'Win32_TimeZone', 'Win32_LogicalMemoryConfiguration', _
		'Win32_OperatingSystem', 'Win32_OperatingSystem', 'Win32_LogicalMemoryConfiguration', 'Win32_LogicalMemoryConfiguration', 'Win32_PageFile']

For $i = 1 To 29
	If $i = 20 Then
		$objWMIService = ObjGet("winmgmts:\\.\root\CIMV2")
		$Instance = $objWMIService.ExecQuery('SELECT ' & StringRegExpReplace($aOS[$i], '.*?[\.]', '') & ' FROM ' & $aWIN32[$i], "WQL", 0x30)
		If $i = 24 Then ConsoleWrite(@LF)
		For $Instances In $Instance

			ConsoleWrite($aOSText[$i] & _Language(Execute($aOS[$i])))
		Next
	EndIf
	If $i = 21 Then
		$objWMIService = ObjGet("winmgmts:\\.\root\CIMV2")
		$CIM = "CIM_DataFile.Name=""" & StringRegExpReplace(_CheckHAL(), '\\', '\\\\') & """"
		$Instance = $objWMIService.Get($CIM)
		ConsoleWrite(@LF)
		ConsoleWrite('Аппаратно зависимый уровень HAL Версия ="' & $Instance.Version & """" & @LF)
	EndIf
	If $i = 9 Then
		$objWMIService = ObjGet("winmgmts:\\.\root\CIMV2")
		$Instance = $objWMIService.ExecQuery('SELECT ' & StringRegExpReplace($aOS[$i], '.*?[\.]', '') & ' FROM ' & $aWIN32[$i], "WQL", 0x30)
		If $i = 24 Then ConsoleWrite(@LF)
		For $Instances In $Instance
			ConsoleWrite($aOSText[$i] & StringRegExpReplace(Execute($aOS[$i]), '(.*?)([\-].*)', 'Компьютер на базе \1'))
		Next
	EndIf
	If $i = 13 Then
		$objWMIService = ObjGet("winmgmts:\\.\root\CIMV2")
		$Instance = $objWMIService.ExecQuery('SELECT ' & StringRegExpReplace($aOS[$i], '.*?[\.]', '') & ' FROM ' & $aWIN32[$i], "WQL", 0x30)
		If $i = 24 Then ConsoleWrite(@LF)
		For $Instances In $Instance
			ConsoleWrite($aOSText[$i] & StringRegExpReplace(Execute($aOS[$i]), '(\s+)', ''))
		Next
	EndIf
	If $i = 14 Then
		$objWMIService = ObjGet("winmgmts:\\.\root\CIMV2")
		$Instance = $objWMIService.ExecQuery('SELECT ' & StringRegExpReplace($aOS[$i], '.*?[\.]', '') & ' FROM ' & $aWIN32[$i], "WQL", 0x30)
		If $i = 24 Then ConsoleWrite(@LF)
		For $Instances In $Instance
			ConsoleWrite($aOSText[$i] & StringRegExpReplace(Execute($aOS[$i]), '(\d{4})(\d{2})(\d{2}).*', ' $3.$2.$1'))
		Next
	EndIf
	If $i = 15 Then
		$objWMIService = ObjGet("winmgmts:\\.\root\CIMV2")
		$Instance = $objWMIService.ExecQuery('SELECT ' & StringRegExpReplace($aOS[$i], '.*?[\.]', '') & ' FROM ' & $aWIN32[$i], "WQL", 0x30)
		If $i = 24 Then ConsoleWrite(@LF)
		For $Instances In $Instance
			ConsoleWrite($aOSText[$i] & StringRegExpReplace(Execute($aOS[$i]), '(\s+).*', ''))
		Next
	EndIf
	If $i = 16 Then
		$objWMIService = ObjGet("winmgmts:\\.\root\CIMV2")
		$Instance = $objWMIService.ExecQuery('SELECT ' & StringRegExpReplace($aOS[$i], '.*?[\.]', '') & ' FROM ' & $aWIN32[$i], "WQL", 0x30)
		If $i = 24 Then ConsoleWrite(@LF)
		For $Instances In $Instance
			ConsoleWrite($aOSText[$i] & StringRegExpReplace(Execute($aOS[$i]), '(\s+).*', ''))
		Next
	EndIf
	If $i = 24 Then
		$objWMIService = ObjGet("winmgmts:\\.\root\CIMV2")
		$Instance = $objWMIService.ExecQuery('SELECT ' & StringRegExpReplace($aOS[$i], '.*?[\.]', '') & ' FROM ' & $aWIN32[$i], "WQL", 0x30)
		If $i = 24 Then ConsoleWrite(@LF)
		For $Instances In $Instance
			ConsoleWrite($aOSText[$i] & Round(Execute($aOS[$i]) / 1024, 2) & ' ')
		Next
	EndIf
	If $i = 25 Then
		$objWMIService = ObjGet("winmgmts:\\.\root\CIMV2")
		$Instance = $objWMIService.ExecQuery('SELECT ' & StringRegExpReplace($aOS[$i], '.*?[\.]', '') & ' FROM ' & $aWIN32[$i], "WQL", 0x30)
		If $i = 25 Then ConsoleWrite(@LF)
		For $Instances In $Instance
			ConsoleWrite($aOSText[$i] & Round(Execute($aOS[$i]) / 1024, 2) & ' ')
		Next
	EndIf
	If $i = 26 Then
		$objWMIService = ObjGet("winmgmts:\\.\root\CIMV2")
		$Instance = $objWMIService.ExecQuery('SELECT ' & StringRegExpReplace($aOS[$i], '.*?[\.]', '') & ' FROM ' & $aWIN32[$i], "WQL", 0x30)
		If $i = 26 Then ConsoleWrite(@LF)
		For $Instances In $Instance
			ConsoleWrite($aOSText[$i] & Round(Execute($aOS[$i]) / 1024, 2) & ' ')
		Next
	EndIf
	If $i = 27 Then
		$objWMIService = ObjGet("winmgmts:\\.\root\CIMV2")
		$Instance = $objWMIService.ExecQuery('SELECT ' & StringRegExpReplace($aOS[$i], '.*?[\.]', '') & ' FROM ' & $aWIN32[$i], "WQL", 0x30)
		If $i = 27 Then ConsoleWrite(@LF)
		For $Instances In $Instance
			ConsoleWrite($aOSText[$i] & Round(Execute($aOS[$i]) / 1024, 2) & ' ')
		Next
	EndIf
	If $i = 28 Then
		$objWMIService = ObjGet("winmgmts:\\.\root\CIMV2")
		$Instance = $objWMIService.ExecQuery('SELECT ' & StringRegExpReplace($aOS[$i], '.*?[\.]', '') & ' FROM ' & $aWIN32[$i], "WQL", 0x30)
		If $i = 28 Then ConsoleWrite(@LF)
		For $Instances In $Instance
			ConsoleWrite($aOSText[$i] & Round(Execute($aOS[$i]) / 1024, 2) & ' ')
		Next
	EndIf
	If $i <> 9 And $i <> 13 And $i <> 14 And $i <> 15 And $i <> 16 And $i <> 20 And $i <> 21 And $i <> 24 And $i <> 25 And $i <> 26 And $i <> 27 And $i <> 28 Then
		$objWMIService = ObjGet("winmgmts:\\.\root\CIMV2")
		$Instance = $objWMIService.ExecQuery('SELECT ' & StringRegExpReplace($aOS[$i], '.*?[\.]', '') & ' FROM ' & $aWIN32[$i], "WQL", 0x30)
		If $i = 2 Or $i = 5 Or $i = 6 Or $i = 7 Or $i = 8 Or $i = 9 Or $i = 10 _
				Or $i = 12 Or $i = 15 Or $i = 17 Or $i = 18 Or $i = 19 Or $i = 20 Or $i = 23 Or $i = 26 Or $i = 29 Then ConsoleWrite(@LF)
		For $Instances In $Instance
			ConsoleWrite($aOSText[$i] & Execute($aOS[$i]) & ' ')
		Next
	EndIf
Next

Func _Language($i_Lang)
	Switch StringLower(Hex($i_Lang, 4))
		Case '0419', '0819'
			Return 'Россия'
		Case '0422'
			Return 'Украинский'
		Case '0423'
			Return 'Белорусский'
		Case '0437'
			Return 'Грузинский'
		Case '082c'
			Return 'Азербайджанский'
		Case '0443', '0843'
			Return 'Узбекский'
		Case '043f'
			Return 'Казахский'
		Case '0444'
			Return 'Татарский'
		Case '0440'
			Return 'Киргизский'
		Case '0413', '0813'
			Return 'Нидерландский'
		Case '0409', '0809', '0c09', '1009', '1409', '1809', '1c09', '2009', '2409', '2809', '2c09', '3009', '3409'
			Return 'Английский'
		Case '040c', '080c', '0c0c', '100c', '140c', '180c'
			Return 'Французский'
		Case '0407', '0807', '0c07', '1007', '1407'
			Return 'Немецкий'
		Case '0410', '0810'
			Return 'Итальянский'
		Case '0414', '0814'
			Return 'Норвежский'
		Case '0416', '0816'
			Return 'Португальский'
		Case '040a', '080a', '0c0a', '100a', '140a', '180a', '1c0a', '200a', '240a', '280a', '2c0a', '300a', '340a', '380a', '3c0a', '400a', '440a', '480a', '4c0a', '500a'
			Return 'Испанский'
		Case '041d', '081d'
			Return 'Шведский'
		Case Else
			Return 'Не удалось определить язык OS'
	EndSwitch
EndFunc   ;==>_Language

Func _CheckHAL()

	Local $aHAL_DLL = _FO_FileSearch(@SystemDir, "Hal*.dll", True, 0)

	Local $aVersPC[7][2] = [['', ''],['Стандартный компьютер', 'Hal.dll'],['Однопроцессорный компьютер с MPS', 'Halapic.dll'], _
			['Многопроцессорный компьютер с MPS', 'Halmps.dll'],['Компьютер с ACPI', 'Halacpi.dll'], _
			['Однопроцессорный компьютер с ACPI', 'Halaacpi.dll'],['Многопроцессорный компьютер с ACPI', 'Halmacpi.dll']]

	$objWMIService = ObjGet("winmgmts:\\.\root\CIMV2")
	$Instance = $objWMIService.ExecQuery('Select Caption from Win32_PnPEntity where DeviceID = "ROOT\\ACPI_HAL\\0000"')
	For $Instances In $Instance
		Local $HAL = $Instances.Caption
	Next

	For $i = 1 To 6
		If $aVersPC[$i][0] = $HAL Then
			Local $GetHAL = $aVersPC[$i][1]
			ExitLoop
		EndIf
	Next

	For $i = 1 To UBound($aHAL_DLL) - 1
		If $GetHAL = FileGetVersion($aHAL_DLL[$i], 'InternalName') Then
			$ValidFile = $aHAL_DLL[$i]
			ExitLoop
		EndIf
	Next

	Return $ValidFile

EndFunc   ;==>_CheckHAL

ConsoleWrite(@LF)
Функция определения языка - Спасибо madmasles
 

joiner

Модератор
Локальный модератор
Сообщения
3,556
Репутация
628
ivsatel
к сожалению вываливается с ошибкой. на скринах: запуск в двух версиях программы
 
Автор
CreatoR

CreatoR

Must AutoIt!
Команда форума
Администратор
Сообщения
8,671
Репутация
2,481
В общем вот что получилось (собрал из кусков в теме + немного отсебятины)...

Код:
#include <Array.au3>

Global $bDebug = True

Global $oWMI, $oItems, $oItem, $aInfo[25][2], $aMethods, _
		$aOS[14][8] = _
			[ _
				[13], _
				['OS Name', '.Caption', '', '', '', '', 0], _
				['Version', '.Version', '.CSDVersion', '"Build " & .BuildNumber', '', ' ', 1, 1], _
				['Other OS Description', '.Description', '', '', '', '', 2], _
				['OS Manufacturer', '.Manufacturer', '', '', '', '', 3], _
				['System Name', '.CSName', '', '', '', '', 4], _
				['Windows Directory', '.WindowsDirectory', '', '', '', '', 11], _
				['System Directory', '.SystemDirectory', '', '', '', '', 12], _
				['Boot Device', '.BootDevice', '', '', '', '', 13], _
				['Locale', 'RegRead("HKCU\Control Panel\International", "sCountry")', '', '', '', '', 14], _
				['Hardware Abstraction Layer', '"Version = """ & RegRead("HKLM\SOFTWARE\Microsoft\DataAccess", "Version") & """"', '', '', '', '', 15], _
				['Available Physical Memory', '_StringGetBytesDisplaySize(.FreePhysicalMemory, 1)', '', '', '', '', 20], _
				['Total Virtual Memory', '_StringGetBytesDisplaySize(.TotalVirtualMemorySize, 1)', '', '', '', '', 21], _
				['Available Virtual Memory', '_StringGetBytesDisplaySize(.FreeVirtualMemory, 1)', '', '', '', '', 22] _
			], _
		$aCS[6][8] = _
			[ _
				[5], _
				['System Manufacturer', '.Manufacturer', '', '', '', '', 5], _
				['System Model', '.Model', '', '', '', '', 6], _
				['System Type', '.SystemType', '', '', '', '', 7], _
				['User Name', '.UserName', '', '', '', '', 16], _
				['Total Physical Memory', '_StringGetBytesDisplaySize(.TotalPhysicalMemory, 0)', '', '', '', '', 19] _
			], _
		$aP[2][8] = _
			[ _
				[1], _
				['Processor', 'StringStripWS(.Name, 4)', '.MaxClockSpeed & " Mhz"', '.NumberOfCores & " Core(s)"', '.NumberOfLogicalProcessors & " Logical Processor(s)"', ', ', 8, 2] _
			], _
		$aB[3][8] = _
			[ _
				[2], _
				['BIOS Version', '.Manufacturer', '.SMBIOSBIOSVersion', 'StringRegExpReplace(.ReleaseDate, "(\d{4})(\d{2})(\d{2}).*", "\3/\2/\1")', '', ', ', 9, 2], _
				['SMBIOS Version', '.SMBIOSMajorVersion', '.SMBIOSMinorVersion', '', '', '.', 10, 1] _
			], _
		$aTZ[2][8] = _
			[ _
				[1], _
				['Time Zone', '.StandardName', '', '', '', '', 17] _
			], _
		$aPFU[3][8] = _
			[ _
				[2], _
				['Page File Space', '_StringGetBytesDisplaySize(.AllocatedBaseSize, 2)', '', '', '', '', 23], _
				['Page File', '.Name', '', '', '', '', 24] _
			], _
		$aPM[2][8] = _
			[ _
				[1], _
				['Installed Physical Memory (RAM)', '_StringGetBytesDisplaySize(.Capacity, 0)', '', '', '', ' + ', 18, 3] _
			], _
		$aFrom[8][2] = _
			[ _
				[7], _
				['Win32_OperatingSystem', $aOS], ['Win32_ComputerSystem', $aCS], _
				['Win32_Processor', $aP], ['Win32_BIOS', $aB], ['Win32_TimeZone', $aTZ], ['Win32_PageFileUsage', $aPFU], ['Win32_PhysicalMemory', $aPM] _
			]

$oWMI = ObjGet('winmgmts:\\' & @ComputerName & '\root\CIMV2')
If @error Then Exit 1

For $w = 1 To $aFrom[0][0]
	$sWin32_Table = $aFrom[$w][0]
	$aMethods = $aFrom[$w][1]
	
	$oItems = $oWMI.ExecQuery('SELECT * FROM ' & $sWin32_Table, 'WQL', 0x30)
	If Not IsObj($oItems) Then Exit 2
	
	_Debug('Win32 Table: ' & $sWin32_Table & @LF)
	
	$iItems_Count = 0
	$iItems_Total = 0
	
	For $oItem In $oItems
		$iItems_Total += 1
	Next
	
	$oItems = $oWMI.ExecQuery('SELECT * FROM ' & $sWin32_Table, 'WQL', 0x30)
	
	For $oItem In $oItems
		$iItems_Count += 1
		
		For $i = 1 To $aMethods[0][0]
			$sAdd_Chars = $aMethods[$i][5]
			$iArr_Count = $aMethods[$i][6]
			$iChars_Trim = $aMethods[$i][7]
			
			_Debug(@TAB & 'Title: ' & $aMethods[$i][0] & @LF)
			
			$aInfo[$iArr_Count][0] = $aMethods[$i][0]
			
			For $j = 1 To 4
				If Not $aMethods[$i][$j] Then
					ExitLoop
				EndIf
				
				_Debug(@TAB & 'Method: ' & $aMethods[$i][$j] & @LF)
				
				$sData = Execute(StringRegExpReplace($aMethods[$i][$j], '(\.\w+)', '\$oItem\1'))
				
				If $sData = '' Then
					$sData = 'Not Available'
				EndIf
				
				_Debug(@TAB & 'Data: ' & $sData & $sAdd_Chars & @LF & @LF)
				
				$aInfo[$iArr_Count][1] &= $sData & $sAdd_Chars
			Next
			
			If $iChars_Trim And $iItems_Count = $iItems_Total Then
				$aInfo[$iArr_Count][1] = StringTrimRight($aInfo[$iArr_Count][1], $iChars_Trim)
			EndIf
		Next
	Next
Next

;~ Run('msinfo32')
_ArrayDisplay($aInfo)

Func _Debug($sData)
	If $bDebug Then
		ConsoleWrite($sData)
	EndIf
EndFunc

Func _StringGetBytesDisplaySize($iInputSize, $iInputUnit = 0, $iRound = 2, $iInputBits = False, $iOutputBits = False, $iOutputUnit = -4)
	Local $aUnitNames[9] = ['', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y']
	Local $iBytes = $iInputSize * 1024 ^ $iInputUnit
	Local $sB = 'B'
	
	If $iInputBits Then $iBytes /= 8
	
	If $iOutputBits Then
		$iBytes *= 8
		$sB = 'b'
	EndIf
	
    If $iOutputUnit < 0 Then
		Local $iOutputMax = Abs($iOutputUnit)
		$iOutputUnit = Int(Log($iBytes) / Log(1024))
		If $iOutputUnit > $iOutputMax Then $iOutputUnit = $iOutputMax
	EndIf
	
	If $aUnitNames[$iOutputUnit] = '' Then $sB = 'Bytes'
	Return String(Round($iBytes / 1024 ^ $iOutputUnit, $iRound)) & ' ' & $aUnitNames[$iOutputUnit] & $sB
EndFunc


вроде все данные совпадают, проверял на 5-ти компьютерах.
 

ivsatel

Продвинутый
Сообщения
319
Репутация
84
Я не ошибаюсь на счет того, что Hardware Abstraction Layer и Microsoft Data Access Components разные вещи?
 

madmasles

Модератор
Глобальный модератор
Сообщения
7,790
Репутация
2,322
CreatoR,
Если запросы сделать адресные (вместо *), то получается очень существенный выигрыш в скорости.
Код:
#include <Array.au3>

Global $bDebug = True, $iTimer = TimerInit()

Global $oWMI, $oItems, $oItem, $aInfo[25][2], $aMethods, $sSelect, _
		$aOS[14][8] = _
		[ _
		[13], _
		['OS Name', '.Caption', '', '', '', '', 0], _
		['Version', '.Version', '.CSDVersion', '"Build " & .BuildNumber', '', ' ', 1, 1], _
		['Other OS Description', '.Description', '', '', '', '', 2], _
		['OS Manufacturer', '.Manufacturer', '', '', '', '', 3], _
		['System Name', '.CSName', '', '', '', '', 4], _
		['Windows Directory', '.WindowsDirectory', '', '', '', '', 11], _
		['System Directory', '.SystemDirectory', '', '', '', '', 12], _
		['Boot Device', '.BootDevice', '', '', '', '', 13], _
		['Locale', 'RegRead("HKCU\Control Panel\International", "sCountry")', '', '', '', '', 14], _
		['Hardware Abstraction Layer', '"Version = """ & RegRead("HKLM\SOFTWARE\Microsoft\DataAccess", "Version") & """"', '', '', '', '', 15], _
		['Available Physical Memory', '_StringGetBytesDisplaySize(.FreePhysicalMemory, 1)', '', '', '', '', 20], _
		['Total Virtual Memory', '_StringGetBytesDisplaySize(.TotalVirtualMemorySize, 1)', '', '', '', '', 21], _
		['Available Virtual Memory', '_StringGetBytesDisplaySize(.FreeVirtualMemory, 1)', '', '', '', '', 22] _
		], _
		$aCS[6][8] = _
		[ _
		[5], _
		['System Manufacturer', '.Manufacturer', '', '', '', '', 5], _
		['System Model', '.Model', '', '', '', '', 6], _
		['System Type', '.SystemType', '', '', '', '', 7], _
		['User Name', '.UserName', '', '', '', '', 16], _
		['Total Physical Memory', '_StringGetBytesDisplaySize(.TotalPhysicalMemory, 0)', '', '', '', '', 19] _
		], _
		$aP[2][8] = _
		[ _
		[1], _
		['Processor', 'StringStripWS(.Name, 4)', '.MaxClockSpeed & " Mhz"', '.NumberOfCores & " Core(s)"', '.NumberOfLogicalProcessors & " Logical Processor(s)"', ', ', 8, 2] _
		], _
		$aB[3][8] = _
		[ _
		[2], _
		['BIOS Version', '.Manufacturer', '.SMBIOSBIOSVersion', 'StringRegExpReplace(.ReleaseDate, "(\d{4})(\d{2})(\d{2}).*", "\3/\2/\1")', '', ', ', 9, 2], _
		['SMBIOS Version', '.SMBIOSMajorVersion', '.SMBIOSMinorVersion', '', '', '.', 10, 1] _
		], _
		$aTZ[2][8] = _
		[ _
		[1], _
		['Time Zone', '.StandardName', '', '', '', '', 17] _
		], _
		$aPFU[3][8] = _
		[ _
		[2], _
		['Page File Space', '_StringGetBytesDisplaySize(.AllocatedBaseSize, 2)', '', '', '', '', 23], _
		['Page File', '.Name', '', '', '', '', 24] _
		], _
		$aPM[2][8] = _
		[ _
		[1], _
		['Installed Physical Memory (RAM)', '_StringGetBytesDisplaySize(.Capacity, 0)', '', '', '', ' + ', 18, 3] _
		], _
		$aFrom[8][3] = _
		[ _
		[7], _
		['Win32_OperatingSystem', $aOS, _
		'Caption,Version,CSDVersion,BuildNumber,Description,Manufacturer,CSName,WindowsDirectory,SystemDirectory,BootDevice,FreePhysicalMemory,TotalVirtualMemorySize,FreeVirtualMemory'], _
		['Win32_ComputerSystem', $aCS, 'Manufacturer,Model,SystemType,UserName,TotalPhysicalMemory'], _
		['Win32_Processor', $aP, 'Name,MaxClockSpeed,NumberOfCores,NumberOfLogicalProcessors'], _
		['Win32_BIOS', $aB, 'Manufacturer,SMBIOSBIOSVersion,ReleaseDate,SMBIOSMajorVersion,SMBIOSMinorVersion'], _
		['Win32_TimeZone', $aTZ, 'StandardName'],['Win32_PageFileUsage', $aPFU, 'AllocatedBaseSize,Name'], _
		['Win32_PhysicalMemory', $aPM, 'Capacity'] _
		]

$oWMI = ObjGet('winmgmts:\\' & @ComputerName & '\root\CIMV2')
If @error Then Exit 1

For $w = 1 To $aFrom[0][0]
	$sWin32_Table = $aFrom[$w][0]
	$aMethods = $aFrom[$w][1]
	$sSelect = $aFrom[$w][2]
;~ 	$sSelect = '*'

	$oItems = $oWMI.ExecQuery('SELECT ' & $sSelect & ' FROM ' & $sWin32_Table, 'WQL', 0x30)
	If Not IsObj($oItems) Then Exit 2

	_Debug('Win32 Table: ' & $sWin32_Table & @LF)

	$iItems_Count = 0
	$iItems_Total = 0

	For $oItem In $oItems
		$iItems_Total += 1
	Next

	$oItems = $oWMI.ExecQuery('SELECT ' & $sSelect & ' FROM ' & $sWin32_Table, 'WQL', 0x30)

	For $oItem In $oItems
		$iItems_Count += 1

		For $i = 1 To $aMethods[0][0]
			$sAdd_Chars = $aMethods[$i][5]
			$iArr_Count = $aMethods[$i][6]
			$iChars_Trim = $aMethods[$i][7]

			_Debug(@TAB & 'Title: ' & $aMethods[$i][0] & @LF)

			$aInfo[$iArr_Count][0] = $aMethods[$i][0]

			For $j = 1 To 4
				If Not $aMethods[$i][$j] Then
					ExitLoop
				EndIf

				_Debug(@TAB & 'Method: ' & $aMethods[$i][$j] & @LF)

				$sData = Execute(StringRegExpReplace($aMethods[$i][$j], '(\.\w+)', '\$oItem\1'))

				If $sData = '' Then
					$sData = 'Not Available'
				EndIf

				_Debug(@TAB & 'Data: ' & $sData & $sAdd_Chars & @LF & @LF)

				$aInfo[$iArr_Count][1] &= $sData & $sAdd_Chars
			Next

			If $iChars_Trim And $iItems_Count = $iItems_Total Then
				$aInfo[$iArr_Count][1] = StringTrimRight($aInfo[$iArr_Count][1], $iChars_Trim)
			EndIf
		Next
	Next
Next

ConsoleWrite(TimerDiff($iTimer) & @LF)
_ArrayDisplay($aInfo)

Func _Debug($sData)
	If $bDebug Then
		ConsoleWrite($sData)
	EndIf
EndFunc   ;==>_Debug

Func _StringGetBytesDisplaySize($iInputSize, $iInputUnit = 0, $iRound = 2, $iInputBits = False, $iOutputBits = False, $iOutputUnit = -4)
	Local $aUnitNames[9] = ['', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y']
	Local $iBytes = $iInputSize * 1024 ^ $iInputUnit
	Local $sB = 'B'

	If $iInputBits Then $iBytes /= 8

	If $iOutputBits Then
		$iBytes *= 8
		$sB = 'b'
	EndIf

	If $iOutputUnit < 0 Then
		Local $iOutputMax = Abs($iOutputUnit)
		$iOutputUnit = Int(Log($iBytes) / Log(1024))
		If $iOutputUnit > $iOutputMax Then $iOutputUnit = $iOutputMax
	EndIf

	If $aUnitNames[$iOutputUnit] = '' Then $sB = 'Bytes'
	Return String(Round($iBytes / 1024 ^ $iOutputUnit, $iRound)) & ' ' & $aUnitNames[$iOutputUnit] & $sB
EndFunc   ;==>_StringGetBytesDisplaySize
И это остается в силе:madmasles [?]
На WinXPx86 Аппаратно-зависимый уровень (HAL) и Размер файла подкачки не совпадают.


Добавлено:
Сообщение автоматически объединено:

Вариант с другим способом получения строки Аппаратно-зависимый уровень (HAL)
Код:
#include <Array.au3>

Global $bDebug = True, $iTimer = TimerInit()

Global $oWMI, $oItems, $oItem, $aInfo[25][2], $aMethods, $sSelect, _
		$aOS[14][8] = _
		[ _
		[13], _
		['OS Name', '.Caption', '', '', '', '', 0], _
		['Version', '.Version', '.CSDVersion', '"Build " & .BuildNumber', '', ' ', 1, 1], _
		['Other OS Description', '.Description', '', '', '', '', 2], _
		['OS Manufacturer', '.Manufacturer', '', '', '', '', 3], _
		['System Name', '.CSName', '', '', '', '', 4], _
		['Windows Directory', '.WindowsDirectory', '', '', '', '', 11], _
		['System Directory', '.SystemDirectory', '', '', '', '', 12], _
		['Boot Device', '.BootDevice', '', '', '', '', 13], _
		['Locale', 'RegRead("HKCU\Control Panel\International", "sCountry")', '', '', '', '', 14], _
		['Hardware Abstraction Layer', '"Version = """ & _Get_Hal_Version() & """"', '', '', '', '', 15], _
		['Available Physical Memory', '_StringGetBytesDisplaySize(.FreePhysicalMemory, 1)', '', '', '', '', 20], _
		['Total Virtual Memory', '_StringGetBytesDisplaySize(.TotalVirtualMemorySize, 1)', '', '', '', '', 21], _
		['Available Virtual Memory', '_StringGetBytesDisplaySize(.FreeVirtualMemory, 1)', '', '', '', '', 22] _
		], _
		$aCS[6][8] = _
		[ _
		[5], _
		['System Manufacturer', '.Manufacturer', '', '', '', '', 5], _
		['System Model', '.Model', '', '', '', '', 6], _
		['System Type', '.SystemType', '', '', '', '', 7], _
		['User Name', '.UserName', '', '', '', '', 16], _
		['Total Physical Memory', '_StringGetBytesDisplaySize(.TotalPhysicalMemory, 0)', '', '', '', '', 19] _
		], _
		$aP[2][8] = _
		[ _
		[1], _
		['Processor', 'StringStripWS(.Name, 4)', '.MaxClockSpeed & " Mhz"', '.NumberOfCores & " Core(s)"', '.NumberOfLogicalProcessors & " Logical Processor(s)"', ', ', 8, 2] _
		], _
		$aB[3][8] = _
		[ _
		[2], _
		['BIOS Version', '.Manufacturer', '.SMBIOSBIOSVersion', 'StringRegExpReplace(.ReleaseDate, "(\d{4})(\d{2})(\d{2}).*", "\3/\2/\1")', '', ', ', 9, 2], _
		['SMBIOS Version', '.SMBIOSMajorVersion', '.SMBIOSMinorVersion', '', '', '.', 10, 1] _
		], _
		$aTZ[2][8] = _
		[ _
		[1], _
		['Time Zone', '.StandardName', '', '', '', '', 17] _
		], _
		$aPFU[3][8] = _
		[ _
		[2], _
		['Page File Space', '_StringGetBytesDisplaySize(.AllocatedBaseSize, 2)', '', '', '', '', 23], _
		['Page File', '.Name', '', '', '', '', 24] _
		], _
		$aPM[2][8] = _
		[ _
		[1], _
		['Installed Physical Memory (RAM)', '_StringGetBytesDisplaySize(.Capacity, 0)', '', '', '', ' + ', 18, 3] _
		], _
		$aFrom[8][3] = _
		[ _
		[7], _
		['Win32_OperatingSystem', $aOS, _
		'Caption,Version,CSDVersion,BuildNumber,Description,Manufacturer,CSName,WindowsDirectory,SystemDirectory,BootDevice,FreePhysicalMemory,TotalVirtualMemorySize,FreeVirtualMemory'], _
		['Win32_ComputerSystem', $aCS, 'Manufacturer,Model,SystemType,UserName,TotalPhysicalMemory'], _
		['Win32_Processor', $aP, 'Name,MaxClockSpeed,NumberOfCores,NumberOfLogicalProcessors'], _
		['Win32_BIOS', $aB, 'Manufacturer,SMBIOSBIOSVersion,ReleaseDate,SMBIOSMajorVersion,SMBIOSMinorVersion'], _
		['Win32_TimeZone', $aTZ, 'StandardName'],['Win32_PageFileUsage', $aPFU, 'AllocatedBaseSize,Name'], _
		['Win32_PhysicalMemory', $aPM, 'Capacity'] _
		]

;~ $oWMI = ObjGet('winmgmts:\\' & @ComputerName & '\root\CIMV2')
$oWMI = ObjGet('winmgmts:\\.\root\CIMV2')
If @error Then Exit 1

For $w = 1 To $aFrom[0][0]
	$sWin32_Table = $aFrom[$w][0]
	$aMethods = $aFrom[$w][1]
	$sSelect = $aFrom[$w][2]
;~ 	$sSelect = '*'

	$oItems = $oWMI.ExecQuery('SELECT ' & $sSelect & ' FROM ' & $sWin32_Table, 'WQL', 0x30)
	If Not IsObj($oItems) Then Exit 2

	_Debug('Win32 Table: ' & $sWin32_Table & @LF)

	$iItems_Count = 0
	$iItems_Total = 0

	For $oItem In $oItems
		$iItems_Total += 1
	Next

	$oItems = $oWMI.ExecQuery('SELECT ' & $sSelect & ' FROM ' & $sWin32_Table, 'WQL', 0x30)

	For $oItem In $oItems
		$iItems_Count += 1

		For $i = 1 To $aMethods[0][0]
			$sAdd_Chars = $aMethods[$i][5]
			$iArr_Count = $aMethods[$i][6]
			$iChars_Trim = $aMethods[$i][7]

			_Debug(@TAB & 'Title: ' & $aMethods[$i][0] & @LF)

			$aInfo[$iArr_Count][0] = $aMethods[$i][0]

			For $j = 1 To 4
				If Not $aMethods[$i][$j] Then
					ExitLoop
				EndIf

				_Debug(@TAB & 'Method: ' & $aMethods[$i][$j] & @LF)

				$sData = Execute(StringRegExpReplace($aMethods[$i][$j], '(\.\w+)', '\$oItem\1'))

				If $sData = '' Then
					$sData = 'Not Available'
				EndIf

				_Debug(@TAB & 'Data: ' & $sData & $sAdd_Chars & @LF & @LF)

				$aInfo[$iArr_Count][1] &= $sData & $sAdd_Chars
			Next

			If $iChars_Trim And $iItems_Count = $iItems_Total Then
				$aInfo[$iArr_Count][1] = StringTrimRight($aInfo[$iArr_Count][1], $iChars_Trim)
			EndIf
		Next
	Next
Next

ConsoleWrite(TimerDiff($iTimer) & @LF)
_ArrayDisplay($aInfo)

Func _Debug($sData)
	If $bDebug Then
		ConsoleWrite($sData)
	EndIf
EndFunc   ;==>_Debug

Func _StringGetBytesDisplaySize($iInputSize, $iInputUnit = 0, $iRound = 2, $iInputBits = False, $iOutputBits = False, $iOutputUnit = -4)
	Local $aUnitNames[9] = ['', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y']
	Local $iBytes = $iInputSize * 1024 ^ $iInputUnit
	Local $sB = 'B'

	If $iInputBits Then $iBytes /= 8

	If $iOutputBits Then
		$iBytes *= 8
		$sB = 'b'
	EndIf

	If $iOutputUnit < 0 Then
		Local $iOutputMax = Abs($iOutputUnit)
		$iOutputUnit = Int(Log($iBytes) / Log(1024))
		If $iOutputUnit > $iOutputMax Then $iOutputUnit = $iOutputMax
	EndIf

	If $aUnitNames[$iOutputUnit] = '' Then $sB = 'Bytes'
	Return String(Round($iBytes / 1024 ^ $iOutputUnit, $iRound)) & ' ' & $aUnitNames[$iOutputUnit] & $sB
EndFunc   ;==>_StringGetBytesDisplaySize

Func _Get_Hal_Version()
	Local $h_Search, $s_File, $s_Version = 'Not available'

	$h_Search = FileFindFirstFile(@SystemDir & '\hal*.dll')
	If $h_Search = -1 Then Return $s_Version
	While 1
		$s_File = FileFindNextFile($h_Search)
		If @error Then ExitLoop
		If @OSVersion = 'WIN_XP' Then
			$s_Version = FileGetVersion(@SystemDir & '\' & $s_File, 'FileVersion')
		Else
			$s_Version = FileGetVersion(@SystemDir & '\' & $s_File)
		EndIf
		If Not @error Then ExitLoop
	WEnd
	FileClose($h_Search)
	Return $s_Version
EndFunc   ;==>_Get_Hal_Version
 

Garrett

Модератор
Локальный модератор
Сообщения
3,999
Репутация
967
CreatoR [?]
Нужен готовый скрипт который будет получать ту же информацию, что мы можем увидеть в System Information

В какой форме оно будет получать особо не важно

Windows XP SP2 - Ok
Windows Vista - not tested
Windows 7 - not tested
Windows 8 - not tested

Код:
$oMSInfo = ObjCreate("Msinfo32.MSInfo.1")

If Not IsObj($oMSInfo) Then 
	MsgBox(16, "MSinfo32", "Object not found!")
	Exit
EndIf

$oMSInfo.UpdateDCOProgress("")
;~ $objMSInfo.SaveFile("ms_info.txt", @ComputerName, "") ; Полная информация (требует время)
$oMSInfo.SaveFile("ms_info.txt", @ComputerName, 0) ; Краткая информация
 

madmasles

Модератор
Глобальный модератор
Сообщения
7,790
Репутация
2,322
Garrett
Win7x86:
Код:
Object not found!
:(
 

Garrett

Модератор
Локальный модератор
Сообщения
3,999
Репутация
967
madmasles
А сама утилита HelpCtr.exe есть?


Добавлено:
Сообщение автоматически объединено:

Код:
[Windows XP]
C:\WINDOWS\pchealth\helpctr\binaries\HelpCtr.exe
 

madmasles

Модератор
Глобальный модератор
Сообщения
7,790
Репутация
2,322
Garrett,
В WinXPSP3x86 есть, в Win7x86 HelpCtr.exe поиском не нашел.
 

Garrett

Модератор
Локальный модератор
Сообщения
3,999
Репутация
967
madmasles
Скажите а msinfo.dll есть?
 

MnM

Post-Hardcore
Сообщения
679
Репутация
90
Garrett
В Windows 8.1 (уверен что даже Windows 8 ) не работает, объекта как и у madmasles нет, и по пути C:\WINDOWS\pchealth\ отсутствует каталог helpctr, там только ERRORREP.
OffTopic:
В Win8 заметно стало что колоссальная часть автономной справки "срезана", осталась только по интернету

 

ivsatel

Продвинутый
Сообщения
319
Репутация
84
По идеи должно быть актуально для этих версий ОС:
[list type=decimal]
[*] Microsoft Windows XP Home Edition
Microsoft Windows XP Professional
Windows Vista Enterprise
Windows Vista Home Premium
Windows Vista Ultimate
Windows Vista Starter
Windows Vista Business
Windows Vista Enterprise 64-bit edition
Windows Vista Home Basic 64-bit edition
Windows Vista Home Premium 64-bit edition
Windows Vista Ultimate 64-bit edition
Windows 7 Корпоративная
Windows 7 Домашняя базовая
Windows 7 Домашняя расширенная
Windows 7 Профессиональная
Windows 7 Начальная
Windows 7 Максимальная
[*]
[/list]
При условии что включена служба "Справки и поддержки"
 

Garrett

Модератор
Локальный модератор
Сообщения
3,999
Репутация
967
ivsatel [?]
На счёт Vist`ы сомневаюсь, а остальные должны вроде.

При условии что включена служба "Справки и поддержки"
Да, служба "Справки и поддержки" должна быть активирована (установлена).


Добавлено:
Сообщение автоматически объединено:

madmasles
Не уверен, но можно попробовать просто зарегистрировать msinfo.dll
Код:
regsvr32 "C:\WINDOWS\pchealth\helpctr\binaries\msinfo.dll"
 

madmasles

Модератор
Глобальный модератор
Сообщения
7,790
Репутация
2,322
CreatoR,
Мой окончательный вариант.
Код:
#include <Array.au3>

Opt('MustDeclareVars', 1)

Global $aInfo, $iTimer = TimerInit()

$aInfo = _Get_Local_System_Info()
If @error Then Exit 13
ConsoleWrite(TimerDiff($iTimer) & @LF)
_ArrayDisplay($aInfo)

#cs
	Вернет массив с Сведениями о системе (по образцу: Пуск -> Выполнить -> msinfo32.exe -> OK)
	$i_Lang			- язык отчета (русский, английский):
	Default или -1	- определит русский или не русский (английский) - по умолчанию;
	0				- английский;
	1				- русский;
	Другое			- по умолчанию.
	-----------------------------
	$f_Debug		- отображения процесса работы функции в консоли: (можно убрать)
	False или 0		- не отображать - по умолчанию;
	True или не 0	- отображать.
	-----------------------------
	Успех			- вернет массив (см. выше);
	Ошибка			- вернет -1 и флаг @error = :
	1				- ошибка ObjGet();
	2				- ошибка $o_WMI.ExecQuery().
	-----------------------------
	Используются функции:
	__Debug;
	__Get_Hal_Version;
	__SizeFormat.
#ce
Func _Get_Local_System_Info($i_Lang = Default, $f_Debug = False)
	Switch $i_Lang
		Case Default, -1
			$i_Lang = StringRegExp(@OSLang, '(0419|0819)')
		Case 0, 1
			;OK
		Case Else
			$i_Lang = StringRegExp(@OSLang, '(0419|0819)')
	EndSwitch

	Local $a_SW[8][2] = [['Not Available', 'Недоступно'], _
			[' Build ', ' Сборка '], _
			['"Version = "', 'Версия = "'], _
			[' Mhz, Core(s): ', ' МГц, ядер: '], _
			[', Logical Processor(s): ', ', логических процессоров: '], _
			['$1/$2/$3', '$3.$2.$1'], _
			['Report collect system information recorded on:', 'Отчет сбора сведений о системе записан на:'], _;английский от translate.google.ru (если коряво, нужно поменять).
			[StringFormat('%s/%s/%s %s:%s:%s', @YEAR, @MON, @MDAY, @HOUR, @MIN, @SEC), StringFormat('%s.%s.%s %s:%s:%s', @MDAY, @MON, @YEAR, @HOUR, @MIN, @SEC)]], _
			$o_WMI, $o_Items, $o, $a_Info[26][2] = [[$a_SW[6][$i_Lang], $a_SW[7][$i_Lang]]], $a_Methods, $s_Select, $s_Win32_Table, $s_Action, $i_Arr_Count, $s_Data, _
			$a_OS[14][4] = [[13], _
			['OS Name', 'Имя ОС', '$o.Caption', 1], _
			['Version', 'Версия', '$o.Version & " " & $o.CSDVersion & $a_SW[1][$i_Lang] & $o.BuildNumber', 2], _
			['Other OS Description', 'Дополнительное описание ОС', '$o.Description', 3], _
			['OS Manufacturer', 'Изготовитель ОС', '$o.Manufacturer', 4], _
			['System Name', 'Имя системы', '$o.CSName', 5], _
			['Windows Directory', 'Папка Windows', '$o.WindowsDirectory', 12], _
			['System Directory', 'Системная папка', '$o.SystemDirectory', 13], _
			['Boot Device', 'Устройство загрузки', '$o.BootDevice', 14], _
			['OS Language', 'Язык системы', 'RegRead("HKCU\Control Panel\International", "sCountry")', 15], _
			['Hardware Abstraction Layer', 'Аппаратно-зависимый уровень (HAL)', '$a_SW[2][$i_Lang] & __Get_Hal_Version() & """"', 16], _
			['Available Physical Memory', 'Доступно физической памяти', '__SizeFormat($o.FreePhysicalMemory, 1, $i_Lang)', 21], _
			['Total Virtual Memory', 'Всего виртуальной памяти', '__SizeFormat($o.TotalVirtualMemorySize, 1, $i_Lang)', 22], _
			['Available Virtual Memory', 'Доступно виртуальной памяти', '__SizeFormat($o.FreeVirtualMemory, 1, $i_Lang)', 23]], _
			$a_CS[6][4] = [[5], _
			['System Manufacturer', 'Изготовитель', '$o.Manufacturer', 6], _
			['System Model', 'Модель', '$o.Model', 7], _
			['System Type', 'Тип', '$o.SystemType', 8], _
			['User Name', 'Имя пользователя', '$o.UserName', 17], _
			['Total Physical Memory (RAM)', 'Полный объем физической памяти', '__SizeFormat($o.TotalPhysicalMemory, 0, $i_Lang)', 20]], _
			$a_P[2][4] = [[1], _
			['Processor', 'Процессор', 'StringStripWS($o.Name, 4) & ", " & $o.MaxClockSpeed & $a_SW[3][$i_Lang] & $o.NumberOfCores & $a_SW[4][$i_Lang] & $o.NumberOfLogicalProcessors', 9]], _
			$a_B[3][4] = [[2], _
			['BIOS Version', 'Версия BIOS', '$o.Manufacturer & ", " & $o.SMBIOSBIOSVersion & ", " & StringRegExpReplace($o.ReleaseDate, "(\d{4})(\d{2})(\d{2}).*", $a_SW[5][$i_Lang])', 10], _
			['SMBIOS Version', 'Версия SMBIOS', '$o.SMBIOSMajorVersion & "." & $o.SMBIOSMinorVersion', 11]], _
			$a_TZ[2][4] = [[1], _
			['Time Zone', 'Часовой пояс', '$o.StandardName', 18]], _
			$a_PFU[3][4] = [[2], _
			['Page File Space', 'Размер файла подкачки', '__SizeFormat($o.AllocatedBaseSize, 2, $i_Lang)', 24], _
			['Page File', 'Файл подкачки', '$o.Name', 25]], _
			$a_PM[2][4] = [[1], _
			['Installed Physical Memory (RAM)', 'Установленная оперативная память (RAM)', '$o.Capacity', 19]], _
			$a_From[8][4] = [[7], _
			['Win32_OperatingSystem', $a_OS, _
			'Caption,Version,CSDVersion,BuildNumber,Description,Manufacturer,CSName,WindowsDirectory,SystemDirectory,BootDevice,FreePhysicalMemory,TotalVirtualMemorySize,FreeVirtualMemory'], _
			['Win32_ComputerSystem', $a_CS, 'Manufacturer,Model,SystemType,UserName,TotalPhysicalMemory'], _
			['Win32_Processor', $a_P, 'Name,MaxClockSpeed,NumberOfCores,NumberOfLogicalProcessors'], _
			['Win32_BIOS', $a_B, 'Manufacturer,SMBIOSBIOSVersion,ReleaseDate,SMBIOSMajorVersion,SMBIOSMinorVersion'], _
			['Win32_TimeZone', $a_TZ, 'StandardName'],['Win32_PageFileUsage', $a_PFU, 'AllocatedBaseSize,Name'], _
			['Win32_PhysicalMemory', $a_PM, 'Capacity', '+']]

	$o_WMI = ObjGet('winmgmts:\\.\root\CIMV2')
	If @error Then Return SetError(1, 0, -1)

	For $w = 1 To $a_From[0][0]
		$s_Win32_Table = $a_From[$w][0]
		$a_Methods = $a_From[$w][1]
		$s_Select = $a_From[$w][2]
		$s_Action = $a_From[$w][3]
		$o_Items = $o_WMI.ExecQuery('SELECT ' & $s_Select & ' FROM ' & $s_Win32_Table, 'WQL', 0x30)
		If Not IsObj($o_Items) Then Return SetError(2, 0, -1)
		If $f_Debug Then __Debug('Win32 Table: ' & $s_Win32_Table)
		For $o In $o_Items
			For $i = 1 To $a_Methods[0][0]
				$i_Arr_Count = $a_Methods[$i][3]
				If $f_Debug Then __Debug(@TAB & 'Title: ' & $a_Methods[$i][0])
				$a_Info[$i_Arr_Count][0] = $a_Methods[$i][$i_Lang]
				If $f_Debug Then __Debug(@TAB & 'Method: ' & $a_Methods[$i][2])
				$s_Data = Execute($a_Methods[$i][2])
				If $s_Data = '' Then
					$s_Data = $a_SW[0][$i_Lang]
				EndIf
				If $f_Debug Then __Debug(@TAB & 'Data: ' & $s_Data & @LF)
				If $s_Action Then
					$a_Info[$i_Arr_Count][1] += $s_Data
				Else
					$a_Info[$i_Arr_Count][1] &= $s_Data
				EndIf
			Next
		Next
		If $s_Action Then
			$a_Info[$i_Arr_Count][1] = __SizeFormat($a_Info[$i_Arr_Count][1], 0, $i_Lang)
			If $f_Debug Then __Debug(@TAB & 'Data: ' & $a_Info[$i_Arr_Count][1] & @LF)
		EndIf
	Next
	Return $a_Info
EndFunc   ;==>_Get_Local_System_Info

Func __Debug($s_Data)
	ConsoleWrite($s_Data & @LF)
EndFunc   ;==>__Debug

Func __Get_Hal_Version()
	Local $h_Search, $s_File, $s_Version = 'Not available'

	$h_Search = FileFindFirstFile(@SystemDir & '\hal*.dll')
	If $h_Search = -1 Then Return $s_Version
	While 1
		$s_File = FileFindNextFile($h_Search)
		If @error Then ExitLoop
		If @OSVersion = 'WIN_XP' Then
			$s_Version = FileGetVersion(@SystemDir & '\' & $s_File, 'FileVersion')
		Else
			$s_Version = FileGetVersion(@SystemDir & '\' & $s_File)
		EndIf
		If Not @error Then ExitLoop
	WEnd
	FileClose($h_Search)
	Return $s_Version
EndFunc   ;==>__Get_Hal_Version

Func __SizeFormat($i_Size, $i_FormatSize, $i_Lang)
	Local $i_Tmp = $i_Size, $s_Ret, $a_Name[5][2] = [['byte', 'байт'],['kB', 'кБ'],['MB', 'МБ'],['GB', 'ГБ'],['TB', 'ТБ']], $i_Ind = -1

	If $i_FormatSize < 4 Then
		For $i = $i_FormatSize To 3
			If $i_Tmp < 1024 Then
				$i_Ind = $i
				ExitLoop
			EndIf
			$i_Tmp /= 1024
		Next
	EndIf
	If $i_Ind = -1 Then $i_Ind = 4
	Return StringFormat('%.2f ' & $a_Name[$i_Ind][$i_Lang], $i_Tmp)
EndFunc   ;==>__SizeFormat
Тестировал на WinXPx86 и Win7x86. На WinXPx86 не совпадает строка "Размер файла подкачки", почему, мне не понятно.


Добавлено:
Сообщение автоматически объединено:

Garrett,
Справка у меня на Win7x86 работает, т.е. соответствующие службы запущены. На WinXPx86 Ваш код работает у меня примерно 2,5 - 3 секунды. ИМХО, долго. Устанавливать на Win7 дополнительную dll смысла не вижу. :smile:
 
Автор
CreatoR

CreatoR

Must AutoIt!
Команда форума
Администратор
Сообщения
8,671
Репутация
2,481
madmasles [?]
Мой окончательный вариант.
Вариант отличный.

У меня получилось сделать свой вариант, я решил не использовать особо массивы, т.к это затрудняет понимание и разбор когда.
Вариант использует строки локализации из msinfo32:

Код:
#include <APIConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <Array.au3>
#include <Date.au3>
#include <Misc.au3>
#include <WinAPIEx.au3>

Global $bDebug = False
Global $aMsInfo32_Strs = _SystemEnumStrings('msinfo32.exe', $RT_STRING)

Global $sMsInfo32_Str = _
	StringRegExpReplace( _
		$aMsInfo32_Strs[282] & @CRLF & $aMsInfo32_Strs[128] & @CRLF & $aMsInfo32_Strs[140] & @CRLF & $aMsInfo32_Strs[130] & @CRLF & $aMsInfo32_Strs[137] & @CRLF & _
		$aMsInfo32_Strs[131] & @CRLF & $aMsInfo32_Strs[139] & @CRLF & $aMsInfo32_Strs[132] & @CRLF & $aMsInfo32_Strs[136] & @CRLF & $aMsInfo32_Strs[142] & '|%s' & @CRLF & _
		$aMsInfo32_Strs[133] & @CRLF & $aMsInfo32_Strs[134] & @CRLF & $aMsInfo32_Strs[135], _
	'%(a|c|d|v|y)', '%s')

Global $sMsInfo32_Str_Byte = $aMsInfo32_Strs[19]
Global $sMsInfo32_Str_KB = $aMsInfo32_Strs[20]
Global $sMsInfo32_Str_MB = $aMsInfo32_Strs[21]
Global $sMsInfo32_Str_GB = $aMsInfo32_Strs[22]
Global $sMsInfo32_Str_TB = $aMsInfo32_Strs[23]
Global $sMsInfo32_Str_Not_Avlbl = $aMsInfo32_Strs[24]

If $bDebug Then
	ConsoleWrite($sMsInfo32_Str & @LF & @LF)
	
	$iIndex = _ArraySearch($aMsInfo32_Strs, 'Часовой', 0, 0, 0, 1)
	
	If $iIndex <> -1 Then
		ConsoleWrite($iIndex & ': ' & $aMsInfo32_Strs[$iIndex] & @LF)
	Else
		ConsoleWrite('NOT FOUND' & @LF)
	EndIf
	
	_ArrayDisplay($aMsInfo32_Strs)
	Exit
EndIf

$oWMI = ObjGet('winmgmts:\\' & @ComputerName & '\root\CIMV2')
If @error Then Exit 1

Global Enum $iOS, $iCS, $iPR, $iBS, $iTZ, $iPF, $iPM

Dim $aTable[7][2] = _
	[ _
		['Win32_OperatingSystem', 'Caption,Version,CSDVersion,BuildNumber,Description,Manufacturer,CSName,WindowsDirectory,SystemDirectory,BootDevice,FreePhysicalMemory,TotalVirtualMemorySize,FreeVirtualMemory'], _
		['Win32_ComputerSystem', 'Manufacturer,Model,SystemType,UserName,TotalPhysicalMemory'], _
		['Win32_Processor', 'Name,MaxClockSpeed,NumberOfCores,NumberOfLogicalProcessors'], _
		['Win32_BIOS', 'Manufacturer,SMBIOSBIOSVersion,ReleaseDate,SMBIOSMajorVersion,SMBIOSMinorVersion'], _
		['Win32_TimeZone', 'StandardName'], _
		['Win32_PageFileUsage', 'AllocatedBaseSize,Name'], _
		['Win32_PhysicalMemory', 'Capacity'] _
	]

$oOS_Items = $oWMI.ExecQuery('SELECT ' & $aTable[$iOS][1] & ' FROM ' & $aTable[$iOS][0], 'WQL', 0x30)
$oCS_Items = $oWMI.ExecQuery('SELECT ' & $aTable[$iCS][1] & ' FROM ' & $aTable[$iCS][0], 'WQL', 0x30)
$oPR_Items = $oWMI.ExecQuery('SELECT ' & $aTable[$iPR][1] & ' FROM ' & $aTable[$iPR][0], 'WQL', 0x30)
$oBS_Items = $oWMI.ExecQuery('SELECT ' & $aTable[$iBS][1] & ' FROM ' & $aTable[$iBS][0], 'WQL', 0x30)
$oTZ_Items = $oWMI.ExecQuery('SELECT ' & $aTable[$iTZ][1] & ' FROM ' & $aTable[$iTZ][0], 'WQL', 0x30)
$oPF_Items = $oWMI.ExecQuery('SELECT ' & $aTable[$iPF][1] & ' FROM ' & $aTable[$iPF][0], 'WQL', 0x30)
$oPM_Items = $oWMI.ExecQuery('SELECT ' & $aTable[$iPM][1] & ' FROM ' & $aTable[$iPM][0], 'WQL', 0x30)

Dim $sOS_Cptn, $sOS_Vrsn, $sOS_CSDVrsn, $sOS_BldNmbr, $sOS_Dscrptn, $sOS_Mnfctr, $sOS_CSName, $sOS_WinDir, $sOS_SysDir, $sOS_BootDvc, $sOS_FreePhsclMem, $sOS_TotlVrtlMemSz, $sOS_FreeVrtlMem
Dim $sCS_Mnfctr, $sCS_Mdl, $sCS_SysType, $sCS_UsrName, $sCS_TotlPhsclMem
Dim $sPR_Name, $sPR_MaxClckSpd, $sPR_NmbrOfCrs, $sPR_NmbrOfLgclPrcs
Dim $sBS_Mnfctr, $sBS_SMBSBSVrsn, $sBS_RlsDate, $sBS_SMBSMjrVrsn, $sBS_SMBSMnrVrsn
Dim $sTZ_StndrdName
Dim $sPF_AllctdBaseSz, $sPF_Name
Dim $sPM_Cpcty

Dim $sReg_Date_Sep = RegRead('HKCU\Control Panel\International', 'sDate')
Dim $sReg_Lang = RegRead('HKCU\Control Panel\International', 'sCountry')
Dim $sReg_HAL = RegRead('HKLM\SOFTWARE\Microsoft\DataAccess', 'Version')

If IsObj($oOS_Items) Then
	For $oItem In $oOS_Items
		With $oItem
			$sOS_Cptn = _Iif(.Caption, .Caption, $sMsInfo32_Str_Not_Avlbl)
			$sOS_Vrsn = _Iif(.Version, .Version, $sMsInfo32_Str_Not_Avlbl)
			$sOS_CSDVrsn = _Iif(.CSDVersion, .CSDVersion, _Iif(.Version = '' And .BuildNumber = '', $sMsInfo32_Str_Not_Avlbl, ''))
			$sOS_BldNmbr = _Iif(.BuildNumber, .BuildNumber, $sMsInfo32_Str_Not_Avlbl)
			$sOS_Dscrptn = _Iif(.Description, .Description, $sMsInfo32_Str_Not_Avlbl)
			$sOS_Mnfctr = _Iif(.Manufacturer, .Manufacturer, $sMsInfo32_Str_Not_Avlbl)
			$sOS_CSName = _Iif(.CSName, .CSName, $sMsInfo32_Str_Not_Avlbl)
			$sOS_WinDir = _Iif(.WindowsDirectory, .WindowsDirectory, $sMsInfo32_Str_Not_Avlbl)
			$sOS_SysDir = _Iif(.SystemDirectory, .SystemDirectory, $sMsInfo32_Str_Not_Avlbl)
			$sOS_BootDvc = _Iif(.BootDevice, .BootDevice, $sMsInfo32_Str_Not_Avlbl)
			$sOS_FreePhsclMem = _Iif(.FreePhysicalMemory, .FreePhysicalMemory, $sMsInfo32_Str_Not_Avlbl)
			$sOS_TotlVrtlMemSz = _Iif(.TotalVirtualMemorySize, .TotalVirtualMemorySize, $sMsInfo32_Str_Not_Avlbl)
			$sOS_FreeVrtlMem = _Iif(.FreeVirtualMemory, .FreeVirtualMemory, $sMsInfo32_Str_Not_Avlbl)
		EndWith
	Next
EndIf

If IsObj($oCS_Items) Then
	For $oItem In $oCS_Items
		With $oItem
			$sCS_Mnfctr = _Iif(.Manufacturer, .Manufacturer, $sMsInfo32_Str_Not_Avlbl)
			$sCS_Mdl = _Iif(.Model, .Model, $sMsInfo32_Str_Not_Avlbl)
			$sCS_SysType = _Iif(.SystemType, .SystemType, $sMsInfo32_Str_Not_Avlbl)
			$sCS_UsrName = _Iif(.UserName, .UserName, $sMsInfo32_Str_Not_Avlbl)
			$sCS_TotlPhsclMem = _Iif(.TotalPhysicalMemory, .TotalPhysicalMemory, $sMsInfo32_Str_Not_Avlbl)
		EndWith
	Next
EndIf

If IsObj($oPR_Items) Then
	For $oItem In $oPR_Items
		With $oItem
			$sPR_Name = _Iif(.Name, .Name, $sMsInfo32_Str_Not_Avlbl)
			$sPR_MaxClckSpd = _Iif(.MaxClockSpeed, .MaxClockSpeed, $sMsInfo32_Str_Not_Avlbl)
			$sPR_NmbrOfCrs = _Iif(.NumberOfCores, .NumberOfCores, $sMsInfo32_Str_Not_Avlbl)
			$sPR_NmbrOfLgclPrcs = _Iif(.NumberOfLogicalProcessors, .NumberOfLogicalProcessors, $sMsInfo32_Str_Not_Avlbl)
		EndWith
	Next
EndIf

If IsObj($oBS_Items) Then
	For $oItem In $oBS_Items
		With $oItem
			$sBS_Mnfctr = _Iif(.Manufacturer, .Manufacturer, $sMsInfo32_Str_Not_Avlbl)
			$sBS_SMBSBSVrsn = _Iif(.SMBIOSBIOSVersion, .SMBIOSBIOSVersion, $sMsInfo32_Str_Not_Avlbl)
			$sBS_RlsDate = _Iif(.ReleaseDate, .ReleaseDate, $sMsInfo32_Str_Not_Avlbl)
			$sBS_SMBSMjrVrsn = _Iif(.SMBIOSMajorVersion, .SMBIOSMajorVersion, $sMsInfo32_Str_Not_Avlbl)
			$sBS_SMBSMnrVrsn = _Iif(.SMBIOSMinorVersion, .SMBIOSMinorVersion, $sMsInfo32_Str_Not_Avlbl)
		EndWith
	Next
	
	Dim $aRls_Date = StringRegExp($sBS_RlsDate, '(\d{4})(\d{2})(\d{2}).*', 3)
	$sBS_RlsDate = StringRegExpReplace($sBS_RlsDate, '\d{2}(\d{2})(\d{2})(\d{2}).*', '\3' & $sReg_Date_Sep & '\2' & $sReg_Date_Sep & '\1')
	
	If UBound($aRls_Date) = 3 Then
		Dim $aDay = DllCall('kernel32.dll', 'int', 'GetLocaleInfoW', 'ulong', 0, 'dword', Mod(_DateToDayOfWeek($aRls_Date[0], $aRls_Date[1], $aRls_Date[2]) + 5, 7) + 42 + 1 * 7, 'wstr', '', 'int', 2048)
		
		If UBound($aDay) >= 3 Then
			$sBS_RlsDate &= ' ' & $aDay[3]
		EndIf
	EndIf
EndIf

If IsObj($oTZ_Items) Then
	For $oItem In $oTZ_Items
		With $oItem
			$sTZ_StndrdName = _Iif(.StandardName, .StandardName, $sMsInfo32_Str_Not_Avlbl)
		EndWith
	Next
EndIf

If IsObj($oPF_Items) Then
	For $oItem In $oPF_Items
		With $oItem
			$sPF_AllctdBaseSz = _Iif(.AllocatedBaseSize, .AllocatedBaseSize, $sMsInfo32_Str_Not_Avlbl)
			$sPF_Name = _Iif(.Name, .Name, $sMsInfo32_Str_Not_Avlbl)
		EndWith
	Next
EndIf

If IsObj($oPM_Items) Then
	For $oItem In $oPM_Items
		With $oItem
			$sPM_Cpcty += _Iif(.Capacity, .Capacity, $sMsInfo32_Str_Not_Avlbl)
		EndWith
	Next
EndIf

$sMsInfo32_Str = _
	StringFormat($sMsInfo32_Str, _
		$sOS_Cptn, $sOS_Vrsn, $sOS_CSDVrsn, $sOS_BldNmbr, $sOS_Dscrptn, $sOS_Mnfctr, $sOS_CSName, $sCS_Mnfctr, $sCS_Mdl, $sCS_SysType, _
		$sPR_Name, $sPR_MaxClckSpd, $sPR_NmbrOfCrs, $sPR_NmbrOfLgclPrcs, _
		$sBS_Mnfctr & ' ' & $sBS_SMBSBSVrsn, $sBS_RlsDate, _
		$sBS_SMBSMjrVrsn & '.' & $sBS_SMBSMnrVrsn, $sOS_WinDir, $sOS_SysDir, $sOS_BootDvc, $sReg_Lang, $sReg_HAL, $sCS_UsrName, $sTZ_StndrdName, _
		_StringGetBytesDisplaySize($sPM_Cpcty, 0), _
		_StringGetBytesDisplaySize($sCS_TotlPhsclMem, 0), _
		_StringGetBytesDisplaySize($sOS_FreePhsclMem, 1), _
		_StringGetBytesDisplaySize($sOS_TotlVrtlMemSz, 1), _
		_StringGetBytesDisplaySize($sOS_FreeVrtlMem, 1), _
		_StringGetBytesDisplaySize($sPF_AllctdBaseSz, 2), _
		$sPF_Name _
	)

$sMsInfo32_Str = StringRegExpReplace($sMsInfo32_Str, '\h+(\r?\n)|(\r?\n)\h+', '\1\2')
$sMsInfo32_Str = StringRegExpReplace($sMsInfo32_Str, '\h+\|', '|')
$sMsInfo32_Str = StringRegExpReplace($sMsInfo32_Str, '\h{2,}', ' ')

Run('msinfo32')
_Display_MSInfo32($sMsInfo32_Str)

Func _Display_MSInfo32($sStr)
	$hGUI = GUICreate('MsInfo32', @DesktopWidth - 200, @DesktopHeight - 300)
	
	$iLV = GUICtrlCreateListView('Title|Value', 20, 20, @DesktopWidth - 240, @DesktopHeight - 380)
	$aSplit = StringSplit(StringStripCR($sStr), @LF)
	
	For $i = 1 To $aSplit[0]
		GUICtrlCreateListViewItem($aSplit[$i], $iLV)
	Next
	
	GUICtrlSendMsg($iLV, $LVM_SETCOLUMNWIDTH, 0, -1)
	GUICtrlSendMsg($iLV, $LVM_SETCOLUMNWIDTH, 1, -1)
	
	GUISetState(@SW_SHOW, $hGUI)
	
	While 1
		Switch GUIGetMsg()
			Case $GUI_EVENT_CLOSE
				ExitLoop
		EndSwitch
	WEnd
	
	GUIDelete($hGUI)
EndFunc

Func _SystemEnumStrings($vModule, $sResType = $RT_STRING)
	Local $aRet[1]
	Local $aModules, $hLibrary, $aData, $hInfo, $hResource, $pData, $iOffset, $iLength
	
	If IsString($vModule) Then
		$aModules = StringSplit($vModule, '|')
	Else
		$aModules = $vModule
	EndIf
	
	For $i = 1 To UBound($aModules)-1
		$hLibrary = _WinAPI_LoadLibraryEx(@SystemDir & '\' & $aModules[$i], $LOAD_LIBRARY_AS_DATAFILE)
		$aData = _WinAPI_EnumResourceNames($hLibrary, $sResType)
		
		For $j = 1 To UBound($aData)-1
			$hInfo = _WinAPI_FindResource($hLibrary, $sResType, $aData[$j])
			$hResource = _WinAPI_LoadResource($hLibrary, $hInfo)
			$pData = _WinAPI_LockResource($hResource)
			
			$iOffset = 0
			
			For $ij = 0 To 15
				$iLength = DllStructGetData(DllStructCreate('ushort', $pData + $iOffset), 1)
				
				If $iLength Then
					$aRet[0] += 1
					ReDim $aRet[$aRet[0]+1]
					
					$aRet[$aRet[0]] = DllStructGetData(DllStructCreate('wchar[' & $iLength & ']', $pData + $iOffset + 2), 1)
				EndIf
				
				$iOffset += 2 * ($iLength + 1)
			Next
		Next
		
		_WinAPI_FreeLibrary($hLibrary)
	Next
	
	Return $aRet
EndFunc

Func _StringGetBytesDisplaySize($iInputSize, $iInputUnit = 0, $iRound = 1, $iInputBits = False, $iOutputBits = False, $iOutputUnit = -4)
	Local $aUnitNames[9] = ['', StringLeft($sMsInfo32_Str_KB, 1), StringLeft($sMsInfo32_Str_MB, 1), StringLeft($sMsInfo32_Str_GB, 1), StringLeft($sMsInfo32_Str_TB, 1), 'P', 'E', 'Z', 'Y']
	Local $iBytes = $iInputSize * 1024 ^ $iInputUnit
	Local $sB = StringRight($sMsInfo32_Str_KB, 1)
	
	If $iInputBits Then $iBytes /= 8
	
	If $iOutputBits Then
		$iBytes *= 8
		$sB = StringLower($sB)
	EndIf
	
    If $iOutputUnit < 0 Then
		Local $iOutputMax = Abs($iOutputUnit)
		$iOutputUnit = Int(Log($iBytes) / Log(1024))
		If $iOutputUnit > $iOutputMax Then $iOutputUnit = $iOutputMax
	EndIf
	
	If $aUnitNames[$iOutputUnit] = '' Then $sB = $sMsInfo32_Str_Byte
	Return String(Round($iBytes / 1024 ^ $iOutputUnit, $iRound)) & ' ' & $aUnitNames[$iOutputUnit] & $sB
EndFunc

Func _Debug($sData)
	If $bDebug Then
		ConsoleWrite($sData)
	EndIf
EndFunc
 

madmasles

Модератор
Глобальный модератор
Сообщения
7,790
Репутация
2,322
CreatoR,
1. У меня на WinXPSP3x86 Ваш скрипт вываливается с ошибкой, в консоли:
Код:
C:\Documents and Settings\madmasles_1\??????? ????\CreatoR.au3 (19) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
Global $sMsInfo32_Str = StringRegExpReplace( $aMsInfo32_Strs[282] & @CRLF & $aMsInfo32_Strs[128] & @CRLF & $aMsInfo32_Strs[140] & @CRLF & $aMsInfo32_Strs[130] & @CRLF & $aMsInfo32_Strs[137] & @CRLF & $aMsInfo32_Strs[131] & @CRLF & $aMsInfo32_Strs[139] & @CRLF & $aMsInfo32_Strs[132] & @CRLF & $aMsInfo32_Strs[136] & @CRLF & $aMsInfo32_Strs[142] & '|%s' & @CRLF & $aMsInfo32_Strs[133] & @CRLF & $aMsInfo32_Strs[134] & @CRLF & $aMsInfo32_Strs[135], '%(a|c|d|v|y)', '%s')
Global $sMsInfo32_Str = StringRegExpReplace( ^ ERROR
->17:14:07 AutoIt3.exe ended.rc:1
2. На WinXPSP3x86 (у меня) msinfo32 запускается только так:
Код:
ShellExecute('msinfo32');на Win7x86 тоже работает
См. первую стр. темы: Yuriy
 

Naisho

Знающий
Сообщения
86
Репутация
12
CreatoR
У меня тоже с ошибкой
Код:
85
(Paused) 
AutoIt Error
AutoIt has detected the stack has become corrupt.

Stack corruption typically occurs when either the wrong calling convention is used or when the function is called with the wrong number of arguments.

AutoIt supports the __stdcall (WINAPI) and __cdecl calling conventions.  The __stdcall (WINAPI) convention is used by default but __cdecl can be used instead.  See the DllCall() documentation for details on changing the calling convention.
Badly formatted "Func" statement.
Missing right bracket ')' in expression.
Missing operator in expression.
Unbalanced brackets in expression.
Error in expression.
Error parsing function call.
Incorrect number of parameters in function call.
"ReDim" used without an array variable.
Illegal text at the end of statement (one statement per line).
"If" statement has no matching "EndIf" statement.
"Else" statement with no matching "If" statement.
"EndIf" statement with no matching "If" statement.
Too many "Else" statements for matching "If" statement.
"While" statement has no matching "Wend" statement.
"Wend" statement with no matching "While" statement.
Variable used without being declared.
Array variable has incorrect number of subscripts or subscript dimension range exceeded.
Array variable subscript badly formatted.
Subscript used with non-Array variable.
Too many subscripts used for an array.
Missing subscript dimensions in "Dim" statement.
No variable given for "Dim", "Local", "Global", "Struct" or "Const" statement.
Expected a "=" operator in assignment statement.
Invalid keyword at the start of this line.
Array maximum size exceeded.
"Func" statement has no matching "EndFunc".
Duplicate function name.
Unknown function name.
Unknown macro.
Unable to get a list of running processes.
Unable to get the process token.
Invalid element in a DllStruct.
Unknown option or bad parameter specified.
Unable to load the internet libraries.
"Struct" statement has no matching "EndStruct".
Unable to open file, the maximum number of open files has been exceeded.
"ContinueLoop" statement with no matching "While", "Do" or "For" statement.
Invalid file filter given.
Expected a variable in user function call.
"Do" statement has no matching "Until" statement.
"Until" statement with no matching "Do" statement.
"For" statement is badly formatted.
"Next" statement with no matching "For" statement.
"ExitLoop/ContinueLoop" statements only valid from inside a For/Do/While loop.
"For" statement has no matching "Next" statement.
"Case" statement with no matching "Select"or "Switch" statement.
"EndSelect" statement with no matching "Select" statement.
Recursion level has been exceeded - AutoIt will quit to prevent stack overflow.
Cannot make existing variables static.
Cannot make static variables into regular variables.
Badly formated Enum statement
This keyword cannot be used after a "Then" keyword.
"Select" statement is missing "EndSelect" or "Case" statement.
"If" statements must have a "Then" keyword.
Badly formated Struct statement.
Cannot assign values to constants.
Cannot make existing variables into constants.
Only Object-type variables allowed in a "With" statement.
"long_ptr", "int_ptr" and "short_ptr" DllCall() types have been deprecated.  Use "long*", "int*" and "short*" instead.
Object referenced outside a "With" statement.
Nested "With" statements are not allowed.
Variable must be of type "Object".
The requested action with this object has failed.
Variable appears more than once in function declaration.
ReDim array can not be initialized in this manner.
An array variable can not be used in this manner.
Can not redeclare a constant.
Can not redeclare a parameter inside a user function.
Can pass constants by reference only to parameters with "Const" keyword.
Can not initialize a variable with itself.
Incorrect way to use this parameter.
"EndSwitch" statement with no matching "Switch" statement.
"Switch" statement is missing "EndSwitch" or "Case" statement.
"ContinueCase" statement with no matching "Select"or "Switch" statement.
Assert Failed!
Obsolete function/parameter.
Invalid Exitcode (reserved for AutoIt internal use).
Unable to parse line.
Unable to open the script file.
String missing closing quote.
Badly formated variable or macro.
Missing separator character after keyword.
E:\Program Files\Auto-it scripts\test_401.au3 (12) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
Global $sMsInfo32_Str = StringRegExpReplace( $aMsInfo32_Strs[282] & @CRLF & $aMsInfo32_Strs[128] & @CRLF & $aMsInfo32_Strs[140] & @CRLF & $aMsInfo32_Strs[130] & @CRLF & $aMsInfo32_Strs[137] & @CRLF & $aMsInfo32_Strs[131] & @CRLF & $aMsInfo32_Strs[139] & @CRLF & $aMsInfo32_Strs[132] & @CRLF & $aMsInfo32_Strs[136] & @CRLF & $aMsInfo32_Strs[142] & '|%s' & @CRLF & $aMsInfo32_Strs[133] & @CRLF & $aMsInfo32_Strs[134] & @CRLF & $aMsInfo32_Strs[135], '%(a|c|d|v|y)', '%s')
Global $sMsInfo32_Str = StringRegExpReplace( ^ ERROR

madmasles
Находит файл подкачки только на "С:\", а на самом деле есть ещё и на другом диске
 
Верх