Board logo

标题: [其他] bat硬件检测 [打印本页]

作者: cmd1152    时间: 2021-10-10 13:43     标题: bat硬件检测

  1. @echo off
  2. cls
  3. color 0a
  4. title 硬件检测
  5. ::mode con cols=90
  6. sc config winmgmt start= auto >nul 2<&1
  7. net start winmgmt 2>nul
  8. setlocal ENABLEDELAYEDEXPANSION
  9. echo 主版:
  10. for /f "tokens=1,* delims==" %%a in ('wmic BASEBOARD get Manufacturer^,Product^,Version^,SerialNumber /value') do (
  11. set /a tee+=1
  12. if "!tee!" == "3" echo 制造商 = %%b
  13. if "!tee!" == "4" echo 型 号 = %%b
  14. if "!tee!" == "5" echo 序列号 = %%b
  15. if "!tee!" == "6" echo 版 本 = %%b
  16. )
  17. set tee=0
  18. echo BIOS:
  19. for /f "tokens=1,* delims==" %%a in ('wmic bios get 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. wmic path Win32_VideoController get /value
  94. echo.
  95. echo 查询显卡(方式二):
  96. del /f "%TEMP%\temp.txt" 2>nul
  97. dxdiag /t %TEMP%\temp.txt
  98. :显卡
  99. rem 这里需要30秒左右!
  100. if EXIST "%TEMP%\temp.txt" (
  101. for /f "tokens=1,2,* delims=:" %%a in ('findstr /c:" Card name:" /c:"Display Memory:" /c:"Current Mode:" "%TEMP%\temp.txt"') do (
  102. set /a tee+=1
  103. if !tee! == 1 echo 显卡型号: %%b
  104. if !tee! == 2 echo 显存大小: %%b
  105. if !tee! == 3 echo 当前设置: %%b
  106. ) ) else (
  107. ping /n 1 127.1>nul
  108. goto 显卡
  109. )
  110. set /p var=需要显卡额外信息吗(y/n):
  111. if /i %var% == y notepad "%TEMP%\temp.txt"
  112. del /f "%TEMP%\temp.txt" 2>nul
  113. pause
复制代码

作者: swanseabrian    时间: 2021-10-10 22:10

回复 1# cmd1152


    大神你好




欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2