home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 February / CMCD0205.ISO / Software / Freeware / Utilitare / pebuild / plugin / chkdsk / chkdsk.cmd < prev    next >
OS/2 REXX Batch file  |  2003-09-30  |  2KB  |  68 lines

  1. @echo off
  2. rem chkdsk.cmd
  3. rem Created by Bart Lagerweij
  4. setlocal
  5. echo CHKDSK.CMD: Starting...
  6. echo.
  7. set _drive=
  8. set _r=
  9. set _f=
  10. echo Please enter the drive, mount point or volume name to check (for example "c:")...
  11. set /p _drive=Enter drive:
  12. if "%_drive%" == "" goto _end
  13. echo.
  14. echo Do you want to fix errors on the disk *and*
  15. echo locate bad sectors and recover readable information (Yes/No)...
  16. :_recinp
  17. set /p _r=Enter "y" or "n":
  18. if "%_r%" == "" goto _recinp
  19. if /I "%_r%" == "y" goto _go
  20. if /I "%_r%" == "n" goto _fix
  21. goto _recinp
  22. :_fix
  23. echo.
  24. echo Do you want to fix errors on the disk (Yes/No)...
  25. :_fixinp
  26. set /p _f=Enter "y" or "n":
  27. if /I "%_f%" == "" goto _fixinp
  28. if /I "%_f%" == "y" goto _go
  29. if /I "%_f%" == "n" goto _go
  30. goto _recinp
  31. :_go
  32. echo.
  33. echo ----------------------------------------------------------------
  34. echo You have specified to check drive/volume %_drive%
  35. echo.
  36. echo With the following options:
  37. if /I "%_r%" == "y" goto _pfix
  38. if /I "%_f%" == "y" goto _pfix
  39. goto _nofix
  40. :_pfix
  41. echo - Fix errors on the disk
  42. :_nofix
  43. if /I "%_r%" == "y" echo - Locate bad sectors and recover readable information (slow!)
  44. echo ----------------------------------------------------------------
  45. echo.
  46. echo Start check disk? (Yes/No)...
  47. :_startinp
  48. set /p _s=Enter "y" or "n":
  49. if /I "%_s%" == "" goto _startinp
  50. if /I "%_s%" == "y" goto _run
  51. if /I "%_s%" == "n" goto _abort
  52. goto _startinp
  53. :_run
  54. if /I "%_f%" == "y" set _param=/f
  55. if /I "%_r%" == "y" set _param=/r
  56. set _param=%_drive% %_param%
  57. echo Running: chkdsk.exe %_param%
  58. chkdsk.exe %_param%
  59. echo.
  60. echo CHKDSK.CMD: Check disk done...
  61. goto _end
  62. :_abort
  63. echo.
  64. echo CHKDSK.CMD: Aborted...
  65. :_end
  66. pause
  67. endlocal
  68.