@Echo off
setlocal enableextensions enabledelayedexpansion
set cdtime=%date:~-10%
if not exist "%~dp0GetInfoYouPC" md "%~dp0GetInfoYouPC"
For /F "Delims=" %%I In (%~dp0pc.list) Do (
Set cpcname=%%~I
set cfile="%~dp0GetInfoYouPC/!cpcname!_%cdtime%.txt"
ping -n 1 !cpcname! | find "TTL"
if !errorlevel!==0 (
For /F "Tokens=1,3* Delims=,:" %%A In ('WMIC OS GET Caption^,Version^,OSArchitecture^,InstallDate /FORMAT:CSV^|FindStr .^|More +1^|FindStr /n .') Do Call :_Func "%%A" "Операционная система: %%B,%%C" "" "!cfile!"
For /F "Tokens=2,3* Delims=,:" %%A In ('WMIC CPU GET socketdesignation^, Name^, MaxClockSpeed /FORMAT:CSV^|FindStr .^|More +1^|FindStr /n .') Do Call :_Func "%%A" "Процессор: %%C,%%B" "" "!cfile!"
For /F "Tokens=2,3* Delims=,:" %%A In ('WMIC memorychip get banklabel^, capacity^, devicelocator /FORMAT:CSV^|FindStr .^|More +1^|FindStr /n .') Do Call :_Func "%%A" "Оперативная память: %%B,%%C" "" "!cfile!"
For /F "Tokens=2,3 Delims==:" %%A In ('WMIC COMPUTERSYSTEM GET TotalPhysicalMemory /VALUE^|FindStr .^|FindStr /n .') Do Call :_Func "%%A" "Оперативная память(в): %%B" "" "!cfile!"
For /F "Tokens=2,3* Delims=,:" %%A In ('WMIC BASEBOARD GET Manufacturer^, Product /FORMAT:CSV^|FindStr .^|More +1^|FindStr /n .') Do Call :_Func "%%A" "Материнская плата: %%B,%%C" "" "!cfile!"
For /F "Tokens=2,3* Delims=,:" %%A In ('WMIC BIOS GET Description^, SMBIOSBIOSVersion /FORMAT:CSV^|FindStr .^|More +1^|FindStr /n .') Do Call :_Func "%%A" "Версия BIOS: %%B,%%C" "" "!cfile!"
For /F "Tokens=2,3* Delims=,:" %%A In ('WMIC path Win32_VideoController GET Name^, AdapterRAM /FORMAT:CSV^|FindStr .^|More +1^|FindStr /n .') Do Call :_Func "%%A" "Видеокарта: %%C,%%B" "" "!cfile!"
For /F "Tokens=2,3* Delims==:" %%A In ('WMIC path Win32_VideoController GET VideoModeDescription /VALUE^|FindStr .^|FindStr /n .') Do Call :_Func "%%A" "Разрешение экрана: %%C" "" "!cfile!"
For /F "Tokens=2,3* Delims=,:" %%A In ('WMIC DISKDRIVE Where ^"InterfaceType^=^'IDE^' or InterfaceType^=^'SCSI^'^" GET Model^, Size^, SerialNumber /FORMAT:CSV^|FindStr .^|More +1^|FindStr /n .') Do Call :_Func "%%A" "Жесткий диск: %%B,%%C" "" "!cfile!"
For /F "Tokens=2,3* Delims==:" %%A In ('WMIC path Win32_CDROMDrive GET Name /VALUE^|FindStr .^|FindStr /n .') Do Call :_Func "%%A" "Привод: %%B" "" "!cfile!"
For /F "Tokens=2,3* Delims==:" %%A In ('WMIC path Win32_NetworkAdapter Where ^"AdapterTypeId^=0 And NetConnectionStatus^=2^" GET Name /VALUE^|FindStr .^|FindStr /n .') Do Call :_Func "%%A" "Сетевая карта: %%B" "" "!cfile!"
For /F "Tokens=2,3* Delims==:" %%A In ('WMIC path Win32_SoundDevice GET Name /VALUE^|FindStr .^|FindStr /n .') Do Call :_Func "%%A" "Звуковая карта: %%B" "" "!cfile!"
For /F "Tokens=2,3* Delims==," %%A In ('WMIC product get name^, version^, installdate /FORMAT:CSV^|FindStr .^|More +1^|FindStr /n .') Do Call :_Func "2" "Установленное ПО: %%B (%%C) (%%A)" "" "!cfile!"
)
)
GoTo :EOF
:_Func
CHCP 1251 1>nul
If %~1 EQU 1 Echo.%~2 >%4
If %~1 GTR 1 Echo.%~2 >>%4
CHCP 866 >nul