我正在尝试运行批处理脚本来获取基本的计算机信息,如 CPU、RAM 和活动网卡。这是我的代码
@Echo OFF
set newline=^& echo.
echo Manufacturer Information> test1.txt
systeminfo|findstr /c:"Host Name" /c:"OS Name" /c:"System Model:" /c:"System Type:" /c:"Total Physical Memory:" >>test1.txt
echo CPU Information:>> test1.txt
wmic cpu get Name /Format:list >> test1.txt
echo %newline%Process Information:>> test1.txt
wmic computersystem get NumberofProcessors /Format:list >> test1.txt
echo %newline%NIC Information:>> test1.txt
wmic nicconfig where "IPEnabled=TRUE" get ipaddress, macaddress,defaultipgateway /format:list >>test1.txt
Run Code Online (Sandbox Code Playgroud)
输出外观:
制造商信息 主机名:DK-IT 操作系统名称:
Microsoft Windows 8.1 单语言系统型号:
Inspiron 7537 系统类型:基于 x64 的 PC 总物理内存:6,043 MB CPU 信息:Run Code Online (Sandbox Code Playgroud)N a …