CODE: [Copy to clipboard]
@echo off
Setlocal EnableDelayedExpansion
set txt1=temp.txt
set txt2=hardinfo.txt
set txt3=log.txt
::set detcet0=path Win32_ComputerSystem get name /value
set detcet1=path win32_processor get name /value
set detcet2=path win32_diskdrive get model /value
set detcet3=path Win32_PhysicalMemoryArray get MaxCapacity /value
set detcet4=Path Win32_CDROMDrive get caption /value
echo. > %txt3%
FOR /F "eol=; tokens=1* delims=, " %%i in (list.txt) do (
ping -n 1 %%i>nul
if not errorlevel 1 (
echo %%i OnLine Detect Now! Please Waiting!
echo %%i,OK >> %txt3%
wmic /node:"%%i" %detcet1% > %txt1%
wmic /node:"%%i" %detcet2% >> %txt1%
wmic /node:"%%i" %detcet3% >> %txt1%
wmic /node:"%%i" %detcet4% >> %txt1%
echo COMPUTERNAME=%%i > %%i-%txt2%
(for /f "tokens=*" %%i in ('more /s %txt1%') do echo %%i ) >> %%i-%txt2%
del %txt1%
)
echo %%i Off Line
echo %%i,Fail >> %txt3%
)
pause