Windows 10 batch process to obtain detailed information of the computer and save it in the specified path

1. Use WMIC to query computer hardware information
1. Command line Use WMIC to query the hardware information command of Windows system

①网卡信息:wmic nicconfig get macaddress
②CPU序列号:wmic cpu get processorid
③主板序列号:wmic baseboard get serialnumber
④BIOS序列号:wmic bios get serialnumber
⑤查看内存详细信息:wmic memorychip
⑥查看内存条数:wmic memorychip list brief
⑦查看缓存内存:wmic memcache list brief
⑧查看磁盘详细信息:wmic diskdrive
⑨查看盘符格式大小以及剩余空间:wmic logicaldisk
2、其他命令
①查看电脑系统属性:dxdiag
②查看系统信息:systeminfo
③查看网络信息:ipconfig /all

2. Create a batch file to obtain the detailed information of the computer
①Create a new text file, and then modify the name of the text file to (obtain the detailed information of the machine) with the suffix (.bat)
insert image description here
②The content of the batch file is:

@echo off
echo 开始获取本机信息,请稍等......

if  exist D:\ComputerInfos.txt (
echo ===================本机已删除旧的信息文件,请重新运行获取!!!==================
del D:\ComputerInfos.txt 
) else (
rem 查看本机系统详细信息
echo 1-本机系统详细信息>>D:\ComputerInfos.txt 
systeminfo>>D:\ComputerInfos.txt 

rem 查看本机CPU信息
echo 2-本机CPU序列号>>D:\ComputerInfos.txt 
 wmic cpu get processorid>>D:\ComputerInfos.txt 
 
rem 2-查看本机主板信息
echo 主板信息(主板厂家、系统序号、主板序列号、主板版本)>>D:\ComputerInfos.txt
wmic baseboard get Manufacturer, Product, SerialNumber, Version>>D:\ComputerInfos.txt 

rem 3-查看本机产品信息
echo 本机信息(本机序列号、品牌、型号)>>D:\ComputerInfos.txt
wmic csproduct get IdentifyingNumber,Vendor, Version>>D:\ComputerInfos.txt 

rem 4-查看本机BIOS信息
echo 本机BIOS信息(本机BIOS序列号)>>D:\ComputerInfos.txt
wmic bios get serialnumber>>D:\ComputerInfos.txt 
rem 查看本机系统信息dxdiag 

rem 5-查看本机的所有网络信息
echo 本机所有网络信息>>D:\ComputerInfos.txt
ipconfig /all>>D:\ComputerInfos.txt 
echo "===================本机信息保存在 D:\ComputerInfos.txt================ "
)
pause

③Select the file (get detailed information of this machine.bat), select "Edit", copy the content of the batch file in ② to the file, and save it as a file (note that the file format is: ANSI) 3. Run (get this
insert image description here
insert image description here
machine Details.bat) Batch command
① Double-click to run
② Wait for the batch program to run
insert image description here
③ View the detailed information file of the machine (storage path: D:\ComputerInfos.txt)
insert image description here

Thanks: https://blog.csdn.net/xiaochenXIHUA/article/details/116489697

Guess you like

Origin blog.csdn.net/weixin_54514751/article/details/130338316