概述 分享一個之前整理的一鍵檢測硬件命令。當你拿到一個新電腦時,不需要再去控制面闆、設備管理器、電腦屬性去一個一個查看了,隻需要複制下這裡腳本内容,一鍵執行就可以了解到硬件的所有信息。
下面介紹下腳本内容。
bat腳本内容: @echo off color 0a title 硬件檢測 mode con cols=90 sc config winmgmt start= auto nul 21 net start winmgmt 21nul setlocal ENABLEDELAYEDEXPANSION echo 主版: for /f "tokens=1,* delims==" %%a in ('wmic BASEBOARD get Manufacturer^,Product^,Version^,SerialNumber /value') do ( set /a tee =1 if "!tee!" == "3" echo 制造商 = %%b if "!tee!" == "4" echo 型 号 = %%b if "!tee!" == "5" echo 序列号 = %%b if "!tee!" == "6" echo 版 本 = %%b ) set tee=0 echo BIOS: for /f "tokens=1,* delims==" %%a in ('wmic bios get CurrentLanguage^,Manufacturer^,SMBIOSBIOSVersion^,SMBIOSMajorVersion^,SMBIOSMinorVersion^,ReleaseDate /value') do ( set /a tee =1 if "!tee!" == "3" echo 當前語言 = %%b if "!tee!" == "4" echo 制造商 = %%b if "!tee!" == "5" echo 發行日期 = %%b if "!tee!" == "6" echo 版 本 = %%b if "!tee!" == "7" echo SMBIOSMajorVersion = %%b if "!tee!" == "8" echo SMBIOSMinorVersion = %%b ) set tee=0 echo. echo CPU: for /f "tokens=1,* delims==" %%a in ('wmic cpu get name^,ExtClock^,CpuStatus^,Description /value') do ( set /a tee =1 if "!tee!" == "3" echo CPU個數 = %%b if "!tee!" == "4" echo 處理器版本 = %%b if "!tee!" == "5" echo 外 頻 = %%b if "!tee!" == "6" echo 名稱及主頻率 = %%b ) set tee=0 echo. echo 顯示器: for /f "tokens=1,* delims==" %%a in ('wmic DESKTOPMONITOR get name^,ScreenWidth^,ScreenHeight^,PNPDeviceID /value') do ( set /a tee =1 if "!tee!" == "3" echo 類 型 = %%b if "!tee!" == "4" echo 其他信息 = %%b if "!tee!" == "5" echo 屏幕高 = %%b if "!tee!" == "6" echo 屏幕寬 = %%b ) set tee=0 echo. echo 硬 盤: for /f "tokens=1,* delims==" %%a in ('wmic DISKDRIVE get model^,interfacetype^,size^,totalsectors^,partitions /value') do ( set /a tee =1 if "!tee!" == "3" echo 接口類型 = %%b if "!tee!" == "4" echo 硬盤型号 = %%b if "!tee!" == "5" echo 分區數 = %%b if "!tee!" == "6" echo 容 量 = %%b if "!tee!" == "7" echo 總扇區 = %%b ) echo 分區信息: wmic LOGICALDISK where mediatype='12' get description,deviceid,filesystem,size,freespace set tee=0 echo. echo 網 卡: for /f "tokens=1,* delims==" %%a in ('wmic NICCONFIG where "index='1'" get ipaddress^,macaddress^,description /value') do ( set /a tee =1 if "!tee!" == "3" echo 網卡類型 = %%b if "!tee!" == "4" echo 網卡IP = %%b if "!tee!" == "5" echo 網卡MAC = %%b ) set tee=0 echo. echo 打印機: for /f "tokens=1,* delims==" %%a in ('wmic PRINTER get caption /value') do ( set /a tee =1 if "!tee!" == "3" echo 打印機名字 = %%b ) set tee=0 echo. echo 聲 卡: for /f "tokens=1,* delims==" %%a in ('wmic SOUNDDEV get name^,deviceid /value') do ( set /a tee =1 if "!tee!" == "3" echo 其他信息 = %%b if "!tee!" == "4" echo 型 号 = %%b ) set tee=0 echo. echo 内 存: for /f "tokens=1,* delims==" %%a in ('systeminfo^|find "内存"') do ( echo %%a 4534 %%b ) echo. echo 顯 卡: del /f "%temp%\temp.txt" 2nul dxdiag /t %TEMP%\temp.txt :顯卡 rem 這裡需要30秒左右! if EXIST "%TEMP%\temp.txt" ( for /f "tokens=1,2,* delims=:" %%a in ('findstr /c:" Card name:" /c:"Display Memory:" /c:"Current Mode:" "%TEMP%\temp.txt"') do ( set /a tee =1 if !tee! == 1 echo 顯卡型号: %%b if !tee! == 2 echo 顯存大小: %%b if !tee! == 3 echo 當前設置: %%b ) ) else ( ping /n 2 127.1nul goto 顯卡 ) set /p var=需要額外信息嗎(y/n): if /i %var% == y notepad "%TEMP%\temp.txt" del /f "%TEMP%\temp.txt" 2nul pause
大家隻需要新建一個txt,複制上面代碼後修改後綴名為bat(本來為txt),然後右鍵以管理員身份運行就可以了。
運行結果:
選擇y可以查看更多信息:
後面會分享更多關于平時工作中用到的一些小技巧,感興趣的朋友可以關注下!!
,
更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!