Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

113 lines
1.6 KiB

  1. @echo off
  2. @rem
  3. @rem SMBCHK - SMBIOS Check
  4. @rem
  5. @rem Compares two SMBIOS dump files. One file is created
  6. @rem by a DOS app and the other is create with WMI query.
  7. @rem
  8. rem
  9. rem Delete the data files first
  10. rem
  11. del smbios.dat
  12. del wmiquery.dat
  13. :get_dos_data
  14. rem
  15. rem See if there's a machine specific SMBIOS.DAT
  16. rem
  17. if exist c:\smbchk.dat goto copy_from_c
  18. if exist %computername%.dat goto copy_machine_data
  19. :dump_data
  20. rem
  21. rem Create the DOS dump file, file is named SMBIOS.DAT
  22. rem
  23. smbdos -v -d
  24. goto end_get_dos_data
  25. :copy_from_c
  26. rem
  27. rem Machine specific file exists as c:\smbios.dat
  28. rem
  29. attrib -r -h -s c:\smbchk.dat
  30. copy c:\smbchk.dat smbios.dat
  31. attrib +r +h +s c:\smbchk.dat
  32. goto end_get_dos_data
  33. :copy_machine_data
  34. rem
  35. rem Machine specific file exists, copy it
  36. rem
  37. copy %computername%.dat smbios.dat
  38. goto end_get_dos_data
  39. :end_get_dos_data
  40. :get_wmi_data
  41. rem
  42. rem Create the WMI query dump file, named WMIQUERY.DAT
  43. rem
  44. smbquery WMIQUERY.DAT
  45. :end_get_wmi_data
  46. :compare
  47. rem
  48. rem Compare the dump files
  49. rem
  50. echo n | comp SMBIOS.DAT WMIQUERY.DAT
  51. smbcmp SMBIOS.DAT WMIQUERY.DAT -break
  52. if errorlevel 1 goto error
  53. echo VAR+PASS compare ok
  54. echo VAR+PASS compare ok > smbchk.log
  55. goto :eof
  56. :error
  57. echo VAR+SEV2 compare failed
  58. echo VAR+SEV2 compare failed > smbchk.log
  59. :end_compare
  60. goto :eof