首页 > 代码库 > 软件硬件外设系统检测检测

软件硬件外设系统检测检测

参考:http://www.cnblogs.com/jikexianfeng/p/6077904.html

软件硬件外设系统检测检测:

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

 简版:

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

 

软件硬件外设系统检测检测