I am working on a batch file and I need help with error messages. I want to make it so if I type in something invalid, the file echoes "Unknown Command!", if I type in "cd /" it goes to the root "directory" that I made in the file, and if I type in "cd [something invalid]", the file will echo "Invalid Path!".
My question is how do I get the file to echo "Invalid Path!" only if I type in something like "cd ggthmk", but make the file echo "Unknown Command!" if anything else invalid is typed.
Here is an example version of the file that illustrates my problem:
@echo off
:/home/
set /p command=$
if /I "%command%"=="cd /" goto cd /
if /I "%command%"=="exit" exit
echo Unkown Command!
goto /home/
:cd /
echo.
echo The current directory is now /
echo.
goto /
:/
set /p command=$
if /I "%command%"=="cd home" goto cd /home/
if /I "%command%"=="exit" exit
echo Unkown Command!
goto /
:cd /home/
echo.
echo The current directory is now /home/
echo.
goto /home/
::-------END-------
Thanks for any help guys!
