I have this code . . .
Code: Select all
set "Drive="
echo Which drive would you like to check for ERRORS?
set /p "Drive=>Please enter the drive letter and press <Enter>: "
if not exist %volume% %Drive%:\ (
echo ERROR: The drive does NOT exist^^!
echo ^>Press ANY key to return to the Options . . . & pause >nul
cls & goto :Options
) else (
if "%Drive%"=="C" (
chkdsk %Drive%: /F
echo press ^<ENTER^> to return to the Options.
echo press ^<Y^> and ^<ENTER^>.
goto :REBOOT_Choice
) else (
chkdsk %Drive%: /F
Please thoroughly check the results above
echo ^>Press ANY key to return to the Options . . . & pause >nul
cls & goto :Options
)
)
[1] If I press <ENTER> instead of entering a drive letter it gives me the correct message . . .
Code: Select all
echo ERROR: The drive does NOT exist^^!
Code: Select all
echo ERROR: The drive does NOT exist^^!
Code: Select all
Please thoroughly check the results above
echo ^>Press ANY key to return to the Options . . . & pause >nul
cls & goto :Options
If I enter C as the drive letter, it prompts me to either enter "Y" to perform chkdsk on the next reboot, or "N" to cancel the process. So far so good.
Code: Select all
if "%Drive%"=="C"
Code: Select all
echo press ^<ENTER^> to return to the Options.
echo press ^<Y^> and ^<ENTER^>.
Code: Select all
goto :REBOOT_Choice
Any help will be greatly appreciated.
Thanks in advance.