|
|
发表于 2024-3-3 16:12:11
|
显示全部楼层
本帖最后由 pda8888 于 2024-3-3 16:14 编辑
- @echo off
- echo.
- nwinfo_x64.exe --cpu --smbios --disk --pci=03 --format=json|jq -r -c "[ \"^
- MB:\t\(.SMBIOS[]^|select(.\"Table Type\" == 1 ) ^|^
- .\"Manufacturer\") \(.SMBIOS[]^|select(.\"Table Type\" == 2 ) ^| ^
- .\"Product Name\")\(.SMBIOS[]^|select(.\"Table Type\" == 0 ) ^| ^
- \" (BIOS Ver=\(.\"Version\"))|\(.\"Release Date\" | split(\"/\") | \"\(.[2])-\(.[0])-\(.[1])\" )\")\t\(.SMBIOS[] ^| select(.\"Table Type\" == 2 ) ^| .\"Serial Number\")\", \"^
- CPU:\t\(.CPUID.CPU0.Brand)\", \"^
- Mem:\t\(.SMBIOS[] ^| select(.\"Table Type\" == 17 ) ^| ^
- select(.\"Manufacturer\" != null) ^|^
- \"\(.Manufacturer)|\(.[\"Part Number\"] | sub(\" +$\"; \"\"))|\(.[\"Device Type\"]) \(.[\"Speed (MT/s)\"]) \((.\"Device Size\" / 1024 / 1024 /1024))GB@\(.[\"Device Locator\"])\t\(.[\"Serial Number\"])\")\", \"^
- VGA:\t\(.PCI[]^|\"\(.Vendor) \(.Device)\")\", \"^
- Disk:\t\(.Disks[]^|\"\(.\"HW Name\") (\(.[\"Health Status\"] | capture(\"\\((?^<percentage^>\\d+%%)\\)\"; \"g\").percentage))@\(.\"Type\") \(.\"Size\" /1000000000 | round)GB\t\(.\"Serial Number\")\")\" ] | join(\"\n\")"
复制代码
这是用了wintoflash大师的nwinfo
和windows版的jq综合出来的,jq语法在批处理环境超级复杂,不晓得吓到了一些小宝宝没有。
jq 1.7.1 executables for AMD64 or i386.
效果是这样的:
好处是不依赖于wmic,PE下可用。
|
|