批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程
[批处理文件精品]批处理版照片整理器[批处理文件精品]纯批处理备份&还原驱动在线第三方下载
返回列表 发帖

分享硬件检测批处理

很好用!
  1. @echo off
  2. color 0a
  3. title   硬件检测     
  4. mode con cols=90
  5. sc config winmgmt start= auto >nul 2<&1
  6. net start winmgmt 2>1nul
  7. setlocal ENABLEDELAYEDEXPANSION
  8. echo 主版:
  9. for /f "tokens=1,* delims==" %%a in ('wmic BASEBOARD get Manufacturer^,Product^,Version^,SerialNumber /value') do (
  10.   set /a tee+=1
  11.   if "!tee!" == "3" echo     制造商   = %%b
  12.   if "!tee!" == "4" echo     型 号   = %%b
  13.   if "!tee!" == "5" echo     序列号   = %%b
  14.   if "!tee!" == "6" echo     版 本   = %%b
  15. )
  16. set tee=0
  17. echo     BIOS:
  18. for /f "tokens=1,* delims==" %%a in ('wmic bios get
  19. CurrentLanguage^,Manufacturer^,SMBIOSBIOSVersion^,SMBIOSMajorVersion^,SMBIOSMinorVersion^,ReleaseDate /value') do (
  20.   set /a tee+=1
  21.   if "!tee!" == "3" echo     当前语言 = %%b
  22.   if "!tee!" == "4" echo     制造商   = %%b
  23.   if "!tee!" == "5" echo     发行日期 = %%b
  24.   if "!tee!" == "6" echo     版 本   = %%b
  25.   if "!tee!" == "7" echo     SMBIOSMajorVersion = %%b
  26.   if "!tee!" == "8" echo     SMBIOSMinorVersion = %%b
  27. )
  28. set tee=0
  29. echo.
  30. echo CPU:
  31. for /f "tokens=1,* delims==" %%a in ('wmic cpu get name^,ExtClock^,CpuStatus^,Description /value') do (
  32.   set /a tee+=1
  33.   if "!tee!" == "3" echo     CPU个数   = %%b
  34.   if "!tee!" == "4" echo     处理器版本   = %%b
  35.   if "!tee!" == "5" echo     外   频   = %%b
  36.   if "!tee!" == "6" echo     名称及主频率   = %%b
  37. )
  38. set tee=0
  39. echo.
  40. echo 显示器:
  41. for /f "tokens=1,* delims==" %%a in ('wmic DESKTOPMONITOR get name^,ScreenWidth^,ScreenHeight^,PNPDeviceID /value') do (
  42.   set /a tee+=1
  43.   if "!tee!" == "3" echo     类   型 = %%b
  44.   if "!tee!" == "4" echo     其他信息 = %%b
  45.   if "!tee!" == "5" echo     屏幕高   = %%b
  46.   if "!tee!" == "6" echo     屏幕宽   = %%b
  47. )
  48. set tee=0
  49. echo.
  50. echo 硬 盘:
  51. for /f "tokens=1,* delims==" %%a in ('wmic DISKDRIVE get model^,interfacetype^,size^,totalsectors^,partitions /value') do (
  52.   set /a tee+=1
  53.   if "!tee!" == "3" echo     接口类型 = %%b
  54.   if "!tee!" == "4" echo     硬盘型号 = %%b
  55.   if "!tee!" == "5" echo     分区数   = %%b
  56.   if "!tee!" == "6" echo     容   量 = %%b
  57.   if "!tee!" == "7" echo     总扇区   = %%b
  58. )
  59. echo 分区信息:
  60. wmic LOGICALDISK where mediatype='12' get description,deviceid,filesystem,size,freespace
  61. set tee=0
  62. echo.
  63. echo 网 卡:
  64. for /f "tokens=1,* delims==" %%a in ('wmic NICCONFIG where "index='1'" get ipaddress^,macaddress^,description /value') do (
  65.   set /a tee+=1
  66.   if "!tee!" == "3" echo     网卡类型 = %%b
  67.   if "!tee!" == "4" echo     网卡IP   = %%b
  68.   if "!tee!" == "5" echo     网卡MAC   = %%b
  69. )
  70. set tee=0
  71. echo.
  72. echo 打印机:
  73. for /f "tokens=1,* delims==" %%a in ('wmic PRINTER get caption /value') do (
  74.   set /a tee+=1
  75.   if "!tee!" == "3" echo     打印机名字 = %%b
  76. )
  77. set tee=0
  78. echo.
  79. echo 声   卡:
  80. for /f "tokens=1,* delims==" %%a in ('wmic SOUNDDEV get name^,deviceid /value') do (
  81.   set /a tee+=1
  82.   if "!tee!" == "3" echo     其他信息 = %%b
  83.   if "!tee!" == "4" echo     型   号 = %%b
  84. )
  85. set tee=0
  86. echo.
  87. echo 内   存:
  88. for /f "tokens=1,* delims==" %%a in ('systeminfo^|find "内存"') do (
  89.   echo       %%a 4534 %%b
  90. )
  91. echo.
  92. echo 显   卡:
  93. del /f "%TEMP%\temp.txt" 2>nul
  94. dxdiag /t %TEMP%\temp.txt
  95. :显卡
  96. rem 这里需要30秒左右!
  97. if EXIST "%TEMP%\temp.txt" (
  98.   for /f "tokens=1,2,* delims=:" %%a in ('findstr /c:" Card name:" /c:"Display Memory:" /c:"Current Mode:" "%TEMP%\temp.txt"') do (
  99.       set /a tee+=1
  100.       if !tee! == 1 echo   显卡型号: %%b
  101.       if !tee! == 2 echo   显存大小: %%b
  102.       if !tee! == 3 echo   当前设置: %%b
  103. )   ) else (
  104.   ping /n 2 127.1>nul
  105.   goto 显卡
  106. )
  107. set /p var=需要额外信息吗(y/n):
  108. if /i %var% == y notepad "%TEMP%\temp.txt"
  109. del /f "%TEMP%\temp.txt" 2>nul
  110. pause
复制代码
2

评分人数

不管黑猫白猫,会捉老鼠的猫就是好猫!

谢谢楼主的辛勤劳动,支持!

TOP

谢谢楼主
的分享。

TOP




支持了

TOP

很好的帖子。学习了啊

TOP

高人呀!

太感谢了。太有用了,!!谢谢

TOP

还是WMIC命令强大啊!

TOP

顶个楼主 (*^__^*) 嘻嘻……

TOP

问楼主,我把驱动程序卸载了,就不能识别了1!!?!?!?这是为什么?

TOP

把硬盘那里改了一下,以适用多硬盘qingkuang"
  1. echo.
  2. echo 硬 盘:
  3. set "model=硬盘型号 ="&set "interfacetype=接口类型 ="&set "partitions=分区数   ="&set "size=容   量  ="
  4. for /f "tokens=1,* delims==" %%a in ('wmic DISKDRIVE get model^,interfacetype^,size^,partitions /value^|more +2') do echo. !%%a!%%b
复制代码

TOP

楼主辛苦了,那么多代码。顶!好贴,谢谢分享。

TOP

顶了,学习中,谢谢各位。。。。。

TOP

找了很久终于找到了!!谢谢楼主
同时也谢谢bat-Batcher兄弟提供的信息

TOP

强大的很
谢谢分享,收藏了

TOP

太有用了,!!谢谢

TOP

返回列表