windows硬件信息获取最快的方式--保存下面代码双击即可

这个功能共需要两个文件(要在同一目录下)

windows硬件信息获取

创建并保存以下两个文件

文件一 hardware_info.bat

## hardware_info.bat
@echo off
setlocal enabledelayedexpansion

:: 运行 PowerShell 脚本
powershell -File "%~dp0hardware_info.ps1"

:: 清理临时文件
@REM del "%~dp0hardware_info.ps1"

endlocal

文件二 hardware_info.ps1

# 定义一个变量来存储输出
# hardware_info.ps1
$Output = @()

# CPU 信息
$Output += "CPU Information:"
$Output += Get-WmiObject Win32_Processor | Format-Table Name, Manufacturer, MaxClockSpeed, NumberOfCores

# 内存信息
$Output += "Memory Information:"
$Output += (Get-WmiObject Win32_PhysicalMemory | Measure-Object -Property Capacity -Sum).Sum / 1GB

# 磁盘信息
$Output += "Disk Drives:"
$Output += Get-WmiObject Win32_DiskDrive | Format-Table DeviceID, Size, MediaType

# BIOS 信息
$Output += "Bios Information:"
$Output += Get-WmiObject Win32_BIOS | Format-Table Manufacturer, SerialNumber, SMBIOSBIOSVersion

# 主板信息
$Output += "Baseboard Information:"
$Output += Get-WmiObject Win32_BaseBoard | Format-Table Manufacturer, Product, Version

# 系统信息
$Output += "Operating System Information:"
$Output += Get-WmiObject Win32_OperatingSystem | Format-Table CSName, OSArchitecture, Version

# 网络适配器信息
$Output += "Network Adapter Configuration:"
$Output += Get-WmiObject Win32_NetworkAdapterConfiguration | Where-Object { $_.IPEnabled -eq $true } | Format-Table Description, IPAddress, IPSubnet

# 显示适配器信息
$Output += "Video Controller Information:"
$Output += Get-WmiObject Win32_VideoController | Format-Table Name, AdapterRAM, VideoModeDescription

# USB 设备信息
$Output += "USB Devices:"
$Output += Get-WmiObject Win32_USBControllerDevice | Format-Table DeviceID, Name

# 电池信息
$Output += "Battery Information:"
$Output += Get-WmiObject Win32_Battery | Format-Table BatteryStatus, EstimatedChargeRemaining, EstimatedTimeOnBattery

# 保存输出到文件
$Output | Out-File -FilePath "D:\temp\hardware_info.txt" -Encoding UT

运行 hardware_info.bat 文件 (双击文件即可!)

windows硬件信息获取

查看输出结果

windows硬件信息获取结果

文件内容如下

CPU Information:

Name                                           Manufacturer MaxClockSpeed NumberOfCores
----                                           ------------ ------------- -------------
11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz GenuineIntel          2803             4


Memory Information:
16
Disk Drives:

DeviceID                   Size MediaType            
--------                   ---- ---------            
\\.\PHYSICALDRIVE0 512105932800 Fixed hard disk media


Bios Information:

Manufacturer SerialNumber SMBIOSBIOSVersion
------------ ------------ -----------------
LENOVO       PF4DDCER     N3WET18W (1.10 ) 


Baseboard Information:

Manufacturer Product    Version       
------------ -------    -------       
LENOVO       20W1A0WCCD SDK0T76479 WIN


Operating System Information:

CSName         OSArchitecture Version   
------         -------------- -------   
IASIA-SZNB-004 6410.0.19045


Network Adapter Configuration:

Description                              IPAddress                                                                     
-----------                              ---------                                                                     
Intel(R) Ethernet Connection (13) I219-V {192.168.50.8, fe80::b2ac:51c3:9e48:863b, 2409:8a55:2ef6:6660:5d58:cbec:de4...
Hyper-V Virtual Ethernet Adapter         {172.22.208.1, fe80::2f04:dff6:2beb:c05c}                                     


Video Controller Information:

Name                         AdapterRAM VideoModeDescription        
----                         ---------- --------------------        
Intel(R) Iris(R) Xe Graphics  134217728 1920 x 1080 x 4294967296 种颜色


USB Devices:

DeviceID Name
-------- ----

Battery Information:

BatteryStatus EstimatedChargeRemaining EstimatedTimeOnBattery
------------- ------------------------ ----------------------
            2                       94                       

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值