WMIC를 활용한 시스템 정보 수집용 스크립트
@echo off
cls
echo GET System Information
if %1$==$ (
rem use the local computer name if nothing is specified
set computer=%computername%
) else (
rem use the computer name passed as a parameter
set computer=%1
)
rem Creating report for %computer%
set htmlfile=%computer%.html
wmic OS get /format:hform > "%htmlfile%"
wmic computersystem get /format:hform >> "%htmlfile%"
wmic service where state="running" get caption,name,pathname,state,status,acceptpause,acceptstop,processid,systemname,startname /format:htable >> "%htmlfile%"
wmic service where state="stopped" get caption,name,pathname,state,status,acceptpause,acceptstop,processid,systemname,startname /format:htable >> "%htmlfile%"
wmic csproduct list brief /format:htable >> "%htmlfile%"
wmic cpu list brief /format:htable >>"%htmlfile%"
wmic diskdrive list brief /format:htable >>"%htmlfile%"
wmic logicaldisk list brief /format:htable >>"%htmlfile%"
wmic volume list brief /format:htable >>"%htmlfile%"
wmic NICCONFIG list brief /format:htable >>"%htmlfile%"
wmic product get name, version /format:htable >> "%htmlfile%"
위와 같은 스크립트를 getSystemInfo.bat와 같은 파일로 저장 후 실행
cls
echo GET System Information
if %1$==$ (
rem use the local computer name if nothing is specified
set computer=%computername%
) else (
rem use the computer name passed as a parameter
set computer=%1
)
rem Creating report for %computer%
set htmlfile=%computer%.html
wmic OS get /format:hform > "%htmlfile%"
wmic computersystem get /format:hform >> "%htmlfile%"
wmic service where state="running" get caption,name,pathname,state,status,acceptpause,acceptstop,processid,systemname,startname /format:htable >> "%htmlfile%"
wmic service where state="stopped" get caption,name,pathname,state,status,acceptpause,acceptstop,processid,systemname,startname /format:htable >> "%htmlfile%"
wmic csproduct list brief /format:htable >> "%htmlfile%"
wmic cpu list brief /format:htable >>"%htmlfile%"
wmic diskdrive list brief /format:htable >>"%htmlfile%"
wmic logicaldisk list brief /format:htable >>"%htmlfile%"
wmic volume list brief /format:htable >>"%htmlfile%"
wmic NICCONFIG list brief /format:htable >>"%htmlfile%"
wmic product get name, version /format:htable >> "%htmlfile%"
위와 같은 스크립트를 getSystemInfo.bat와 같은 파일로 저장 후 실행