Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for sndisk3.bat

(view source code of sndisk3.bat as plain text)

  1. @ECHO OFF
  2. :: Check Windows version: batch file not suited for DOS.
  3. IF NOT "%OS%"=="Windows_NT" GOTO Syntax
  4.  
  5. :: No command line arguments required.
  6. IF NOT "%~1"=="" GOTO Syntax
  7.  
  8. :: Localaize variables
  9. SETLOCAL
  10.  
  11. :: Check availability and version of IBM's E-Gatherer tool.
  12. SET EGather2Available=
  13. SET Download=
  14. %COMSPEC% /C EGATHER2.EXE -help 2>&1 | FIND.EXE "2.37" >NUL || (
  15. 	SET EGather2Available=No
  16. 	ECHO This batch file requires IBM's E-Gatherer 2.37.
  17. 	SET /P Download=Do you want to download it now? [y/N] 
  18. ) >CON
  19.  
  20. :: Start download if requested.
  21. IF /I "%Download:~0,1%"=="Y" (
  22. 	START "EGather2" "http://www.pc.ibm.com/qtechinfo/MIGR-4R5VKC.html"
  23. 	ECHO.
  24. 	ECHO Download EGATHER2.EXE and store it in the current directory or the PATH.
  25. 	ECHO.
  26. 	PAUSE
  27. 	START "EGather2Fix" "http://www.ibm.com/pc/support/site.wss/document.do?lndocid=MIGR-54588"
  28. 	ECHO Next download the latest IBM Access Support fix pack and follow
  29. 	ECHO IBM's installation instructions.
  30. 	ECHO.
  31. 	PAUSE
  32. ) >CON
  33.  
  34. :: Abort if EGATHER2.EXE still isn't available.
  35. %COMSPEC% /C EGATHER2.EXE -help 2>&1 | FIND.EXE "2.37" >NUL && (SET EGather2Available=)
  36. IF NOT "%EGather2Available%"=="" GOTO End
  37.  
  38. :: Run the test and display the result.
  39. :: Remove "-probes IDE_DEVICE_INFORMATION SCSI_DEVICES" if
  40. :: you want a full system summary instead of harddisks only.
  41. :: Or run EGATHER2 -listprobes to list other available tests.
  42. FOR /F "tokens=5*" %%A IN ('EGATHER2.EXE -batch -html -probes IDE_DEVICE_INFORMATION SCSI_DEVICES 2^>^&1 ^| FIND.EXE "Close HTML Output File"') DO START "HTML" "%%~B"
  43. GOTO End
  44.  
  45.  
  46. :Syntax
  47. ECHO.
  48. ECHO SNDisk3.bat,  Version 1.10 for Windows 2000 / XP / Server 2003
  49. ECHO Display harddisk characteristics using IBM's EGather2 Version 2.37
  50. ECHO.
  51. ECHO Usage:  SNDISK3
  52. ECHO.
  53. ECHO Notes:  A HTML file will be stored in the current directory.
  54. ECHO         IBM's EGather2 plus security patch can be downloaded at:
  55. ECHO         http://www.pc.ibm.com/qtechinfo/MIGR-4R5VKC.html and
  56. ECHO         http://www.ibm.com/pc/support/site.wss/document.do?lndocid=MIGR-54588
  57. ECHO         This batch file will automatically prompt you for
  58. ECHO         download if EGather2 is not available on your system.
  59. ECHO         Read the comments if you want to modify this batch file
  60. ECHO         to run a full inventory instead of just harddisks.
  61. ECHO.
  62. ECHO Written by Rob van der Woude
  63. ECHO http://www.robvanderwoude.com
  64.  
  65.  
  66. :End
  67. IF "%OS%"=="Windows_NT" ENDLOCAL
  68.  

page last modified: 2024-04-16; loaded in 0.0105 seconds