获取windows系统硬件信息收集cmd脚本
chcp 65001
set file="host_message.txt"
echo 获取ip地址: >>%file%
ipconfig |findstr IPv4>>%file%
echo. >>%file%
echo 获取主机名,系统版本,内存容量等信息: >> %file%
systeminfo |findstr "Host OS Memory" >> %file%
echo. >>%file%
echo 获取硬盘容量(单位:B): >> %file%
wmic DiskDrive get Size >> %file%
::echo. >>%file%
::echo 获取内存容量: >>%file%
::wmic memorychip list brief >> %file%
::systeminfo | findstr Memory >> %file%
echo. >>%file%
echo 获取cpu型号: >> %file%
wmic cpu list brief | findstr CPU >> %file%
::systeminfo
------------------------
优化版本:
chcp 65001
mkdir d:\sysinfo\
del d:\sysinfo\host_message.txt
del d:\sysinfo\host_message.txt
set file="host_message.txt"
echo. >>d:\sysinfo\%file%
echo 获取主机名,系统版本,内存容量等信息: >> d:\sysinfo\%file%
systeminfo |findstr "Host OS Memory" >>d:\sysinfo\%file%
echo. >>d:\sysinfo\%file%
echo 获取cpu型号: >> d:\sysinfo\%file%
wmic cpu list brief | findstr CPU >> d:\sysinfo\%file%
echo. >>d:\sysinfo\%file%
echo 获取内存条数量: >>d:\sysinfo\%file%
wmic /output:temp.txt memorychip list brief
type temp.txt >> d:\sysinfo\%file%
echo. >>d:\sysinfo\%file%
echo 获取硬盘信息(单位:Byte): >> d:\sysinfo\%file%
wmic diskdrive get caption,size,interfacetype,MediaType >> d:\sysinfo\%file%
Wmic logicaldisk get Caption, Description,FileSystem,DriveType, VolumeName, FreeSpace ,Size >> d:\sysinfo\%file%
:: DriveType: 2=移动磁盘、3=本地磁盘、5=光驱。
fsutil volume diskfree c: >> d:\sysinfo\%file%
echo. >>d:\sysinfo\%file%
echo 当前计算ip/mac地址: >>d:\sysinfo\%file%
wmic /output:d:\sysinfo\ipmac.txt nicconfig get IPAddress
type d:\sysinfo\ipmac.txt >> d:\sysinfo\%file%
::systeminfo
本文链接:https://www.kinber.cn/post/2642.html 转载需授权!
推荐本站淘宝优惠价购买喜欢的宝贝: