Что нового

Аналог System Information

madmasles

Модератор
Глобальный модератор
Сообщения
7,790
Репутация
2,322
Naisho [?]
Находит файл подкачки только на "С:\", а на самом деле есть ещё и на другом диске
У меня на 3-х ноутбуках установлено по 2 системы. Если просто искать файлы pagefile.sys, то находит больше одного. Как определить, какие из них относятся к текущей системе, я не знаю.
 

Naisho

Знающий
Сообщения
86
Репутация
12
madmasles
Значение REG_MULTI_SZ. Указаны размещение и размер всех имеющихся в системе файлов подкачки
Код:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management]

"PagingFiles"=hex(7):......................
 

madmasles

Модератор
Глобальный модератор
Сообщения
7,790
Репутация
2,322
Naisho,
У меня на Win7x86 в этой ветке PagingFiles = ?:\pagefile.sys и ExistingPageFiles = \??\C:\pagefile.sys.


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

CreatoR [?]
Можно посмотреть на содержимое массива $aMsInfo32_Strs?
AutoIt 3.3.8.1
Код:
0	85                                      
-----
1	(Paused)                                
-----
2	AutoIt Error                            
-----
3	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.
-----
4	Badly formatted "Func" statement.       
-----
5	Missing right bracket ')' in expression.
-----
6	Missing operator in expression.         
-----
7	Unbalanced brackets in expression.      
-----
8	Error in expression.                    
-----
9	Error parsing function call.            
-----
10	Incorrect number of parameters in function call.
-----
11	"ReDim" used without an array variable. 
-----
12	Illegal text at the end of statement (one statement per line).
-----
13	"If" statement has no matching "EndIf" statement.
-----
14	"Else" statement with no matching "If" statement.
-----
15	"EndIf" statement with no matching "If" statement.
-----
16	Too many "Else" statements for matching "If" statement.
-----
17	"While" statement has no matching "Wend" statement.
-----
18	"Wend" statement with no matching "While" statement.
-----
19	Variable used without being declared.   
-----
20	Array variable has incorrect number of subscripts or subscript dimension range exceeded.
-----
21	Array variable subscript badly formatted.
-----
22	Subscript used with non-Array variable. 
-----
23	Too many subscripts used for an array.  
-----
24	Missing subscript dimensions in "Dim" statement.
-----
25	No variable given for "Dim", "Local", "Global", "Struct" or "Const" statement.
-----
26	Expected a "=" operator in assignment statement.
-----
27	Invalid keyword at the start of this line.
-----
28	Array maximum size exceeded.            
-----
29	"Func" statement has no matching "EndFunc".
-----
30	Duplicate function name.                
-----
31	Unknown function name.                  
-----
32	Unknown macro.                          
-----
33	Unable to get a list of running processes.
-----
34	Unable to get the process token.        
-----
35	Invalid element in a DllStruct.         
-----
36	Unknown option or bad parameter specified.
-----
37	Unable to load the internet libraries.  
-----
38	"Struct" statement has no matching "EndStruct".
-----
39	Unable to open file, the maximum number of open files has been exceeded.
-----
40	"ContinueLoop" statement with no matching "While", "Do" or "For" statement.
-----
41	Invalid file filter given.              
-----
42	Expected a variable in user function call.
-----
43	"Do" statement has no matching "Until" statement.
-----
44	"Until" statement with no matching "Do" statement.
-----
45	"For" statement is badly formatted.     
-----
46	"Next" statement with no matching "For" statement.
-----
47	"ExitLoop/ContinueLoop" statements only valid from inside a For/Do/While loop.
-----
48	"For" statement has no matching "Next" statement.
-----
49	"Case" statement with no matching "Select"or "Switch" statement.
-----
50	"EndSelect" statement with no matching "Select" statement.
-----
51	Recursion level has been exceeded - AutoIt will quit to prevent stack overflow.
-----
52	Cannot make existing variables static.  
-----
53	Cannot make static variables into regular variables.
-----
54	Badly formated Enum statement           
-----
55	This keyword cannot be used after a "Then" keyword.
-----
56	"Select" statement is missing "EndSelect" or "Case" statement.
-----
57	"If" statements must have a "Then" keyword.
-----
58	Badly formated Struct statement.        
-----
59	Cannot assign values to constants.      
-----
60	Cannot make existing variables into constants.
-----
61	Only Object-type variables allowed in a "With" statement.
-----
62	"long_ptr", "int_ptr" and "short_ptr" DllCall() types have been deprecated.  Use "long*", "int*" and "short*" instead.
-----
63	Object referenced outside a "With" statement.
-----
64	Nested "With" statements are not allowed.
-----
65	Variable must be of type "Object".      
-----
66	The requested action with this object has failed.
-----
67	Variable appears more than once in function declaration.
-----
68	ReDim array can not be initialized in this manner.
-----
69	An array variable can not be used in this manner.
-----
70	Can not redeclare a constant.           
-----
71	Can not redeclare a parameter inside a user function.
-----
72	Can pass constants by reference only to parameters with "Const" keyword.
-----
73	Can not initialize a variable with itself.
-----
74	Incorrect way to use this parameter.    
-----
75	"EndSwitch" statement with no matching "Switch" statement.
-----
76	"Switch" statement is missing "EndSwitch" or "Case" statement.
-----
77	"ContinueCase" statement with no matching "Select"or "Switch" statement.
-----
78	Assert Failed!                          
-----
79	Obsolete function/parameter.            
-----
80	Invalid Exitcode (reserved for AutoIt internal use).
-----
81	Unable to parse line.                   
-----
82	Unable to open the script file.         
-----
83	String missing closing quote.           
-----
84	Badly formated variable or macro.       
-----
85	Missing separator character after keyword.
-----
 
Автор
CreatoR

CreatoR

Must AutoIt!
Команда форума
Администратор
Сообщения
8,671
Репутация
2,481
madmasles
А если так:

Код:
Global $aMsInfo32_Strs = _SystemEnumStrings('msinfo32.exe', $RT_STRING, @WindowsDir)

...

Func _SystemEnumStrings($vModule, $sResType = $RT_STRING, $sModulePath = @SystemDir)
	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($sModulePath & '\' & $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
 

madmasles

Модератор
Глобальный модератор
Сообщения
7,790
Репутация
2,322
CreatoR [?]
То же самое ::smile:
Код:
0	85                                      
-----
1	(Paused)                                
-----
2	AutoIt Error                            
-----
3	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.
-----
4	Badly formatted "Func" statement.       
-----
5	Missing right bracket ')' in expression.
-----
6	Missing operator in expression.         
-----
7	Unbalanced brackets in expression.      
-----
8	Error in expression.                    
-----
9	Error parsing function call.            
-----
10	Incorrect number of parameters in function call.
-----
11	"ReDim" used without an array variable. 
-----
12	Illegal text at the end of statement (one statement per line).
-----
13	"If" statement has no matching "EndIf" statement.
-----
14	"Else" statement with no matching "If" statement.
-----
15	"EndIf" statement with no matching "If" statement.
-----
16	Too many "Else" statements for matching "If" statement.
-----
17	"While" statement has no matching "Wend" statement.
-----
18	"Wend" statement with no matching "While" statement.
-----
19	Variable used without being declared.   
-----
20	Array variable has incorrect number of subscripts or subscript dimension range exceeded.
-----
21	Array variable subscript badly formatted.
-----
22	Subscript used with non-Array variable. 
-----
23	Too many subscripts used for an array.  
-----
24	Missing subscript dimensions in "Dim" statement.
-----
25	No variable given for "Dim", "Local", "Global", "Struct" or "Const" statement.
-----
26	Expected a "=" operator in assignment statement.
-----
27	Invalid keyword at the start of this line.
-----
28	Array maximum size exceeded.            
-----
29	"Func" statement has no matching "EndFunc".
-----
30	Duplicate function name.                
-----
31	Unknown function name.                  
-----
32	Unknown macro.                          
-----
33	Unable to get a list of running processes.
-----
34	Unable to get the process token.        
-----
35	Invalid element in a DllStruct.         
-----
36	Unknown option or bad parameter specified.
-----
37	Unable to load the internet libraries.  
-----
38	"Struct" statement has no matching "EndStruct".
-----
39	Unable to open file, the maximum number of open files has been exceeded.
-----
40	"ContinueLoop" statement with no matching "While", "Do" or "For" statement.
-----
41	Invalid file filter given.              
-----
42	Expected a variable in user function call.
-----
43	"Do" statement has no matching "Until" statement.
-----
44	"Until" statement with no matching "Do" statement.
-----
45	"For" statement is badly formatted.     
-----
46	"Next" statement with no matching "For" statement.
-----
47	"ExitLoop/ContinueLoop" statements only valid from inside a For/Do/While loop.
-----
48	"For" statement has no matching "Next" statement.
-----
49	"Case" statement with no matching "Select"or "Switch" statement.
-----
50	"EndSelect" statement with no matching "Select" statement.
-----
51	Recursion level has been exceeded - AutoIt will quit to prevent stack overflow.
-----
52	Cannot make existing variables static.  
-----
53	Cannot make static variables into regular variables.
-----
54	Badly formated Enum statement           
-----
55	This keyword cannot be used after a "Then" keyword.
-----
56	"Select" statement is missing "EndSelect" or "Case" statement.
-----
57	"If" statements must have a "Then" keyword.
-----
58	Badly formated Struct statement.        
-----
59	Cannot assign values to constants.      
-----
60	Cannot make existing variables into constants.
-----
61	Only Object-type variables allowed in a "With" statement.
-----
62	"long_ptr", "int_ptr" and "short_ptr" DllCall() types have been deprecated.  Use "long*", "int*" and "short*" instead.
-----
63	Object referenced outside a "With" statement.
-----
64	Nested "With" statements are not allowed.
-----
65	Variable must be of type "Object".      
-----
66	The requested action with this object has failed.
-----
67	Variable appears more than once in function declaration.
-----
68	ReDim array can not be initialized in this manner.
-----
69	An array variable can not be used in this manner.
-----
70	Can not redeclare a constant.           
-----
71	Can not redeclare a parameter inside a user function.
-----
72	Can pass constants by reference only to parameters with "Const" keyword.
-----
73	Can not initialize a variable with itself.
-----
74	Incorrect way to use this parameter.    
-----
75	"EndSwitch" statement with no matching "Switch" statement.
-----
76	"Switch" statement is missing "EndSwitch" or "Case" statement.
-----
77	"ContinueCase" statement with no matching "Select"or "Switch" statement.
-----
78	Assert Failed!                          
-----
79	Obsolete function/parameter.            
-----
80	Invalid Exitcode (reserved for AutoIt internal use).
-----
81	Unable to parse line.                   
-----
82	Unable to open the script file.         
-----
83	String missing closing quote.           
-----
84	Badly formated variable or macro.       
-----
85	Missing separator character after keyword.
-----
Код:
$aMsInfo32_Strs = _SystemEnumStrings('msinfo32.exe', $RT_STRING, @CommonFilesDir & '\Microsoft Shared\MSInfo')
Код:
0	9                                       
-----
1	%1 в ожидаемом месте не найден          
-----
2	Вы не имеете права на доступ к %1       
-----
3	Неизвестная ошибка при выполнении %1    
-----
4	Не удалось найти MMC.EXE.               
-----
5	Сведения о системе                      
-----
6	Недостаточно памяти. Закройте неиспользуемые приложения и повторите попытку.
-----
7	Внутренняя ошибка.                      
-----
8	Не удалось найти MSINFO32.MSC.          
-----
9	 
Использование: msinfo32 [ /? | /msinfo_file=<файл> | /s <файл> |  
		/nfo <файл> |  /report <файл> ] 
	[ /computer <компьютер> ] 
	[ /categories (+|-)(all|<категория>)[(+|-)(<категория>)...] 
	[ /category <категория>]]
         
/?		Вывод этой справки 
/msinfo_file	Открытие указанного файла NFO или CAB 
/nfo или /s	Вывод NFO в указанный файл 
/report		Вывод форматированного текстового файла в указанный файл 
/computer	Подключение к указанному компьютеру 
/categories	Отображение или вывод указанных категорий 
/category	Установка фокуса на указанную категорию при запуске
-----
 
Автор
CreatoR

CreatoR

Must AutoIt!
Команда форума
Администратор
Сообщения
8,671
Репутация
2,481
madmasles [?]
Значит будем считать что оно не поддерживает WinXP.
Можно конечно для такого случая сделать несколько версии локализации (скопировать форматированную строку с Win7), но мне в принципе поддержка WinXP особо уже не нужна.
 
Автор
CreatoR

CreatoR

Must AutoIt!
Команда форума
Администратор
Сообщения
8,671
Репутация
2,481
Прикрепил версию с поддержкой WinXP.
 

madmasles

Модератор
Глобальный модератор
Сообщения
7,790
Репутация
2,322
Автор
CreatoR

CreatoR

Must AutoIt!
Команда форума
Администратор
Сообщения
8,671
Репутация
2,481
madmasles [?]
На WinXPx86 Аппаратно-зависимый уровень (HAL) и Размер файла подкачки не совпадают.
Это виртуальная машина?
 
Автор
CreatoR

CreatoR

Must AutoIt!
Команда форума
Администратор
Сообщения
8,671
Репутация
2,481
А если так?
 

MnM

Post-Hardcore
Сообщения
679
Репутация
90
CreatoR

Думаю комментировать подробно даже не стоит, я затер некоторую информацию - но там то же было не правильно(вставлялось имя компьютера или учетной записи)
Хотя мне было приятно осознавать что на моем ноутбуке ОЗУ = Россия :laugh:
 

MnM

Post-Hardcore
Сообщения
679
Репутация
90
madmasles
Ваш пример выдает правильные данные
 
Автор
CreatoR

CreatoR

Must AutoIt!
Команда форума
Администратор
Сообщения
8,671
Репутация
2,481
А ещё лучше, выложить сам файл msinfo32.exe с Win 8.
 

MnM

Post-Hardcore
Сообщения
679
Репутация
90
CreatoR
Прикрепил файл текстовый с массивом $aMsInfo32_Strs, как я понял это 2 переменная в вашем последнем скрипте
+ в архиве системный msinfo32.exe
 
Автор
CreatoR

CreatoR

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

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

Global $bDebug = True
Global $aMsInfo32_Strs = _SystemEnumStrings('msinfo32.exe', $RT_STRING)
Global $sMsInfo32_Str, $sDecimal_Format = '%.2f'
Global $sMsInfo32_Str_Byte, $sMsInfo32_Str_KB, $sMsInfo32_Str_MB, $sMsInfo32_Str_GB, $sMsInfo32_Str_TB, $sMsInfo32_Str_NA

;Win Vista or higher and $aMsInfo32_Strs includes 283 or more items
If Hex($__WINVER, 4) >= 0600 And UBound($aMsInfo32_Strs) >= 283 Then
	Dim Enum $iStr_Byte = 19, $iStr_KB, $iStr_MB, $iStr_GB, $iStr_TB, $iStr_NA
	Dim $iStr_DcmlFrmt = 37
	Dim $iStr_1 = 282, $iStr_2 = 128, $iStr_3 = 140, $iStr_4 = 130, $iStr_5 = 137, $iStr_6 = 131, $iStr_7 = 139, $iStr_8 = 132, $iStr_9 = 136, $iStr_10 = 142, $iStr_11 = 133, $iStr_12 = 134, $iStr_13 = 135
	
	;Win 8 or higher
	If Hex($__WINVER, 4) > 0601 Then
		Dim $iStr_3 = 154 ;, $iStr_4 = 129, 
	EndIf
	
	$sMsInfo32_Str_Byte = $aMsInfo32_Strs[$iStr_Byte]
	$sMsInfo32_Str_KB = $aMsInfo32_Strs[$iStr_KB]
	$sMsInfo32_Str_MB = $aMsInfo32_Strs[$iStr_MB]
	$sMsInfo32_Str_GB = $aMsInfo32_Strs[$iStr_GB]
	$sMsInfo32_Str_TB = $aMsInfo32_Strs[$iStr_TB]
	$sMsInfo32_Str_NA = $aMsInfo32_Strs[$iStr_NA]
	
	$sDecimal_Format = StringRegExpReplace($aMsInfo32_Strs[$iStr_DcmlFrmt], ' .{2} .*$', '')
	
	$sMsInfo32_Str = _
		StringRegExpReplace( _
			$aMsInfo32_Strs[$iStr_1] & @CRLF & $aMsInfo32_Strs[$iStr_2] & @CRLF & $aMsInfo32_Strs[$iStr_3] & @CRLF & $aMsInfo32_Strs[$iStr_4] & @CRLF & $aMsInfo32_Strs[$iStr_5] & @CRLF & _
			$aMsInfo32_Strs[$iStr_6] & @CRLF & $aMsInfo32_Strs[$iStr_7] & @CRLF & $aMsInfo32_Strs[$iStr_8] & @CRLF & $aMsInfo32_Strs[$iStr_9] & @CRLF & $aMsInfo32_Strs[$iStr_10] & '|%s' & @CRLF & _
			$aMsInfo32_Strs[$iStr_11] & @CRLF & $aMsInfo32_Strs[$iStr_12] & @CRLF & $aMsInfo32_Strs[$iStr_13], _
		'%(a|c|d|v|y)', '%s')
Else
	;MsgBox(16, 'SysInfo - Error', 'This utility supports only Win Vista/7.')
	;Exit
	
	If @OSLang = 0419 Then ;Russian
		$sMsInfo32_Str_Byte = 'Байт'
		$sMsInfo32_Str_KB = 'КБ'
		$sMsInfo32_Str_MB = 'МБ'
		$sMsInfo32_Str_GB = 'ГБ'
		$sMsInfo32_Str_TB = 'ТБ'
		$sMsInfo32_Str_NA = 'Недоступно'
	   
		$sMsInfo32_Str = _
			'Имя ОС|%s' & @CRLF & _
			'Версия|%s %s Сборка %s' & @CRLF & _
			'Дополнительное описание ОС|%s' & @CRLF & _
			'Изготовитель ОС|%s' & @CRLF & _
			'Имя системы|%s' & @CRLF & _
			'Изготовитель|%s' & @CRLF & _
			'Модель|%s' & @CRLF & _
			'Тип|%s' & @CRLF & _
			'Процессор|%s, %s МГц, ядер: %s, логических процессоров: %s' & @CRLF & _
			'Версия BIOS|%s, %s' & @CRLF & _
			'Версия SMBIOS|%s' & @CRLF & _
			'Папка Windows|%s' & @CRLF & _
			'Системная папка|%s' & @CRLF & _
			'Устройство загрузки|%s' & @CRLF & _
			'Язык системы|%s' & @CRLF & _
			'Аппаратно-зависимый уровень (HAL)|Версия = "%s"' & @CRLF & _
			'Имя пользователя|%s' & @CRLF & _
			'Часовой пояс|%s' & @CRLF & _
			'Установленная оперативная память (RAM)|%s' & @CRLF & _
			'Полный объем физической памяти|%s' & @CRLF & _
			'Доступно физической памяти|%s' & @CRLF & _
			'Всего виртуальной памяти|%s' & @CRLF & _
			'Доступно виртуальной памяти|%s' & @CRLF & _
			'Размер файла подкачки|%s' & @CRLF & _
			'Файл подкачки|%s'
	Else
		$sMsInfo32_Str_Byte = 'Byte'
		$sMsInfo32_Str_KB = 'KB'
		$sMsInfo32_Str_MB = 'MB'
		$sMsInfo32_Str_GB = 'GB'
		$sMsInfo32_Str_TB = 'TB'
		$sMsInfo32_Str_NA = 'Not Available'
	  
		$sMsInfo32_Str = _
			'OS Name|%s' & @CRLF & _
			'Version|%s %s Build %s' & @CRLF & _
			'Other OS Description|%s' & @CRLF & _
			'OS Manufacturer|%s' & @CRLF & _
			'System Name|%s' & @CRLF & _
			'System Manufacturer|%s' & @CRLF & _
			'System Model|%s' & @CRLF & _
			'System Type|%s' & @CRLF & _
			'Processor|%s, %s Mhz, %s Core(s), %s Logical Processor(s)' & @CRLF & _
			'BIOS Version/Date|%s, %s' & @CRLF & _
			'SMBIOS Version|%s' & @CRLF & _
			'Windows Directory|%s' & @CRLF & _
			'System Directory|%s' & @CRLF & _
			'Boot Device|%s' & @CRLF & _
			'Locale|%s' & @CRLF & _
			'Hardware Abstraction Layer|Version = "%s"' & @CRLF & _
			'User Name|%s' & @CRLF & _
			'Time Zone|%s' & @CRLF & _
			'Installed Physical Memory (RAM)|%s' & @CRLF & _
			'Total Physical Memory|%s' & @CRLF & _
			'Available Physical Memory|%s' & @CRLF & _
			'Total Virtual Memory|%s' & @CRLF & _
			'Available Virtual Memory|%s' & @CRLF & _
			'Page File Space|%s' & @CRLF & _
			'Page File|%s'
	EndIf
EndIf

_Debug()

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

Global Enum $iOS, $iCS, $iPR, $iBS, $iTZ, $iPF, $iPM
Global $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'] _
	]

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

Global $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
Global $sCS_Mnfctr, $sCS_Mdl, $sCS_SysType, $sCS_UsrName, $sCS_TotlPhsclMem
Global $sPR_Name, $sPR_MaxClckSpd, $sPR_NmbrOfCrs, $sPR_NmbrOfLgclPrcs
Global $sBS_Mnfctr, $sBS_SMBSBSVrsn, $sBS_RlsDate, $sBS_SMBSMjrVrsn, $sBS_SMBSMnrVrsn
Global $sTZ_StndrdName
Global $sPF_AllctdBaseSz, $sPF_Name
Global $sPM_Cpcty

Global $sReg_Date_Sep = RegRead('HKCU\Control Panel\International', 'sDate')
Global $iReg_Digits = 2 ;RegRead('HKCU\Control Panel\International', 'iDigits') ;MsInfo32 uses %.2f, not system decimal digit
Global $sReg_Lang = RegRead('HKCU\Control Panel\International', 'sCountry')
Global $sReg_HAL = _SystemGetHalVersion() ;RegRead('HKLM\SOFTWARE\Microsoft\DataAccess', 'Version')

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

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

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

If IsObj($oBS_Items) Then
	For $oItem In $oBS_Items
		With $oItem
			$sBS_Mnfctr = _DataGet(.Manufacturer)
			$sBS_SMBSBSVrsn = _DataGet(.SMBIOSBIOSVersion)
			$sBS_RlsDate = _DataGet(.ReleaseDate)
			$sBS_SMBSMjrVrsn = _DataGet(.SMBIOSMajorVersion)
			$sBS_SMBSMnrVrsn = _DataGet(.SMBIOSMinorVersion)
		EndWith
	Next
	
	Local $aRls_Date = StringRegExp($sBS_RlsDate, '(\d{4})(\d{2})(\d{2}).*', 3)
	
	If UBound($aRls_Date) = 3 Then
		$sBS_RlsDate = _DateTimeFormat($aRls_Date[0] & '/' & $aRls_Date[1] & '/' & $aRls_Date[2], 2)
		
		Local $iDayOfWeek = _DateToDayOfWeek($aRls_Date[0], $aRls_Date[1], $aRls_Date[2])
		Local $aDay = DllCall('kernel32.dll', 'int', 'GetLocaleInfoW', 'ulong', 0, 'dword', Mod($iDayOfWeek + 5, 7) + 42 + 1 * 7, 'wstr', '', 'int', 2048)
		
		If UBound($aDay) >= 3 And StringRegExp($sBS_RlsDate, '(Sun|Mon|Tue|Wed|Thu|Fri|Sat)$') Then
			$sBS_RlsDate = StringTrimRight($sBS_RlsDate, 3) & $aDay[3]
		EndIf
	EndIf
EndIf

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

If IsObj($oPF_Items) Then
	For $oItem In $oPF_Items
		With $oItem
			$sPF_AllctdBaseSz = _DataGet(.AllocatedBaseSize)
			$sPF_Name = _DataGet(.Name)
		EndWith
	Next
	
	If Hex($__WINVER, 4) < 0600 Then ;Lower than Win Vista
		$aMemStats = MemGetStats()
		$sPF_AllctdBaseSz = $aMemStats[3] / 1024
	EndIf
EndIf

If IsObj($oPM_Items) Then
	For $oItem In $oPM_Items
		With $oItem
			$sPM_Cpcty += _DataGet(.Capacity)
		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, $iReg_Digits, $sDecimal_Format), _
		_StringGetBytesDisplaySize($sCS_TotlPhsclMem, 0, $iReg_Digits, $sDecimal_Format), _
		_StringGetBytesDisplaySize($sOS_FreePhsclMem, 1, $iReg_Digits, $sDecimal_Format), _
		_StringGetBytesDisplaySize($sOS_TotlVrtlMemSz, 1, $iReg_Digits, $sDecimal_Format), _
		_StringGetBytesDisplaySize($sOS_FreeVrtlMem, 1, $iReg_Digits, $sDecimal_Format), _
		_StringGetBytesDisplaySize($sPF_AllctdBaseSz, 2, $iReg_Digits, $sDecimal_Format), _
		$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,}', ' ')

;~ ShellExecute('msinfo32.exe')
_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 _Debug($sData = '')
	If Not $bDebug Then
		Return
	EndIf
	
	If $sData <> '' Then
		ConsoleWrite($sData)
	Else
		Dim $aStrs = _
			StringSplit( _
				'Имя ОС|Версия|Дополнительное описание ОС|Изготовитель ОС|Имя системы|Изготовитель|Модель|Тип|Процессор|Версия BIOS|Версия SMBIOS|' & _
				'Папка Windows|Системная папка|Устройство загрузки|Язык системы|Аппаратно-зависимый уровень (HAL)|Версия|Имя пользователя|Часовой пояс|' & _
				'Установленная оперативная память (RAM)|Полный объем физической памяти|Доступно физической памяти|Всего виртуальной памяти|Доступно виртуальной памяти|Размер файла подкачки|Файл подкачки', _
			'|')
		
		ConsoleWrite(@CRLF & @CRLF & '------------ Indexes msinfo32 data ------------' & @CRLF & @CRLF)
		
		For $i = 1 To $aStrs[0]
			$iIndex = _ArraySearch($aMsInfo32_Strs, $aStrs[$i], 0, 0, 0, 1)
			
			If $iIndex <> -1 Then
				ConsoleWrite($i & ') ' & $iIndex & ':' & @CRLF & @TAB & StringReplace($aMsInfo32_Strs[$iIndex], @LF, @LF & @TAB) & @CRLF)
			Else
				ConsoleWrite($i & ') NOT FOUND' & @CRLF)
			EndIf
		Next
		
		ConsoleWrite(@CRLF & @CRLF & '------------ Raw msinfo32 data ------------' & $sMsInfo32_Str & @CRLF & @CRLF)
		
		;_ArrayDisplay($aMsInfo32_Strs)
		Exit
	EndIf
EndFunc

Func _DataGet($sData, $bIif = -1)
	If IsBool($bIif) Then
		Return _Iif($sData, $sData, _Iif($bIif, $sMsInfo32_Str_NA, ''))
	Else
		Return _Iif($sData, $sData, $sMsInfo32_Str_NA)
	EndIf
EndFunc

Func _SystemGetHalVersion()
	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

Func _SystemEnumStrings($vModule, $sResType = $RT_STRING, $sModulePath = @SystemDir)
	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($sModulePath & '\' & $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 = 2, $sFormat = '', $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 $sFormat = '' Then
		$sFormat = '%d'
	Else
		$iRound = -1
	EndIf
	
	If $iInputBits Then
		$iBytes /= 8
	EndIf
	
	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
	EndIf
	
	If $iRound = -1 Then
		Return StringFormat($sFormat, ($iBytes / 1024 ^ $iOutputUnit)) & ' ' & $aUnitNames[$iOutputUnit] & $sB
	EndIf
	
	Return StringFormat($sFormat, Round($iBytes / 1024 ^ $iOutputUnit, $iRound)) & ' ' & $aUnitNames[$iOutputUnit] & $sB
EndFunc
 

inververs

AutoIT Гуру
Сообщения
2,135
Репутация
465
Код:
--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop


------------ Indexes msinfo32 data ------------

1) 127:
	Имя ОС|%s
	Версия|%s %s Сборка %s
	Изготовитель ОС|%s
2) 62:
	Версия
3) 141:
	Имя ОС|%s
	Версия|%s Сборка %s
	Дополнительное описание ОС |%s
	Изготовитель ОС|%s
4) 127:
	Имя ОС|%s
	Версия|%s %s Сборка %s
	Изготовитель ОС|%s
5) 128:
	Имя системы|%s
	Изготовитель|%s
	Модель|%s
	Тип|%v
6) 66:
	Изготовитель
7) 128:
	Имя системы|%s
	Изготовитель|%s
	Модель|%s
	Тип|%v
8) 39:
	Программа сбора сведений о системе не может открывать файлы этого типа.
9) 129:
	Процессор|%s %s МГц
10) 130:
	Версия BIOS|%s, %c
11) 137:
	Версия SMBIOS|%s
12) 131:
	Папка Windows|%s
	Системная папка|%s
	Устройство загрузки|%s
	Язык системы|%a
13) 131:
	Папка Windows|%s
	Системная папка|%s
	Устройство загрузки|%s
	Язык системы|%a
14) 131:
	Папка Windows|%s
	Системная папка|%s
	Устройство загрузки|%s
	Язык системы|%a
15) 131:
	Папка Windows|%s
	Системная папка|%s
	Устройство загрузки|%s
	Язык системы|%a
16) 139:
	Аппаратно-зависимый уровень (HAL)|Версия = "%s"
17) 62:
	Версия
18) 132:
	Имя пользователя|%s
19) 136:
	Часовой пояс|%s
20) 142:
	Установленная оперативная память (RAM)
21) 133:
	Полный объем физической памяти|%y
22) 134:
	Доступно физической памяти|%y
	Всего виртуальной памяти|%y
	Доступно виртуальной памяти|%y
	Размер файла подкачки|%y
23) 134:
	Доступно физической памяти|%y
	Всего виртуальной памяти|%y
	Доступно виртуальной памяти|%y
	Размер файла подкачки|%y
24) 134:
	Доступно физической памяти|%y
	Всего виртуальной памяти|%y
	Доступно виртуальной памяти|%y
	Размер файла подкачки|%y
25) 134:
	Доступно физической памяти|%y
	Всего виртуальной памяти|%y
	Доступно виртуальной памяти|%y
	Размер файла подкачки|%y
26) 135:
	Файл подкачки|%s


------------ Raw msinfo32 data ------------Имя ОС|%s
Версия|%s %s Сборка %s
Дополнительное описание ОС |%s
Изготовитель ОС|%s
Имя системы|%s
Изготовитель|%s
Модель|%s
Тип|%s
Процессор|%s, %s МГц, ядер: %s, логических процессоров: %s
Версия BIOS|%s, %s
Версия SMBIOS|%s
Папка Windows|%s
Системная папка|%s
Устройство загрузки|%s
Язык системы|%s
Аппаратно-зависимый уровень (HAL)|Версия = "%s"
Имя пользователя|%s
Часовой пояс|%s
Установленная оперативная память (RAM)|%s
Полный объем физической памяти|%s
Доступно физической памяти|%s
Всего виртуальной памяти|%s
Доступно виртуальной памяти|%s
Размер файла подкачки|%s
Файл подкачки|%s

+>14:24:32 AutoIt3.exe ended.rc:0
 

MnM

Post-Hardcore
Сообщения
679
Репутация
90
CreatoR
inververs
Точно так же как и у inververs
 
Верх