@echo off
setlocal enabledelayedexpansion
if exist C:\dell\%computername%.csv del C:\dell\%computername%.csv"
set outputfile="C:\dell\%computername%.csv"
for /F %%i in (C:\machines.txt) do (
wmic /node:%%i computersystem get name >> %outputfile%
wmic /node:%%i Cpu get Name >> %outputfile%
wmic /node:%%i path win32_VideoController get name >> %outputfile%
WMIC /node:%%i LOGICALDISK where drivetype=3 get caption,size,FreeSpace >> %outputfile%
wmic /node:%%i ComputerSystem get TotalPhysicalMemory >> %outputfile%
)
goto :eof
Open in new window
»bp