Thank you ALL for the replies.
I am a bit poorly at the moment so I am sorry that I have not got back to any of you.
When I feel a little better I will thoroughly go through this whole thread and take it all in, and answer each of your posts individually.
You are all brilliant at what you do.
I thought I would post all the
ORIGINAL code before I started so you can see exactly what I had and what I was doing, which seems to work OK.
The drives could be any letter depending on how it was setup.
I think you are probably right about using CHOICE as it is easier to control wrong input!
Code: Select all
:chkdsk_F
cls
set "Drive="
echo. & echo Which drive would you like to check for ERRORS? & echo.
set /p "Drive=>Enter the drive letter and press <Enter>: "
if /i not exist %Drive%:\ goto :chkdsk_F_ERROR
if /i "%Drive%"=="C" goto :chkdsk_F_C
if /i not "%Drive%"=="C" goto :chkdsk_F_Other
:chkdsk_F_ERROR
echo. & echo ERROR: The drive does NOT exist^^!
echo. & echo ^>Press ANY key to return to the Menu . . . & pause >nul
cls & goto :Menu
:chkdsk_F_C
echo. & echo Running chkdsk %Drive%: /F . . .
echo ----------------------------------------------------------------------------------------
echo. & chkdsk %Drive%: /F
echo. & echo ----------------------------------------------------------------------------------------
echo. & echo If you DON'T want to REBOOT NOW, press ^<Enter^> to return to the Menu.
echo If you DO want to REBOOT NOW, press ^<Y^> and ^<Enter^>.
echo ----------------------------------------------------------------------------------------
echo. & goto :REBOOT_Choice
:chkdsk_F_Other
echo. & echo Running chkdsk %Drive%: /F . . .
echo ----------------------------------------------------------------------------------------
echo. & chkdsk %Drive%: /F
echo. & echo ----------------------------------------------------------------------------------------
echo IMPORTANT:
echo. & echo Please thoroughly check the results.
echo ----------------------------------------------------------------------------------------
echo. & echo ^>Press ANY key to return to the Menu . . . & pause >nul
cls & goto :Menu
As I said, once I am feeling better in a couple of days hopefully, I want to really get this sorted.
Thanks again everyone, it is appreciated.