How do I give an error message in a batch file if a program isn’t found?


I’m extremely new to programming. I’m talking just dipping my toes in the water new. I toying with batch files using notepad to open files on a removable drive, so that I can eventually get a bit more efficient with whatever I may be doing.

Bear with me, because I’m learning as I go I’ve learned a decent bit from following along with the internet

I found a template online for a file that asks for a username and password, and if they’re correct, it will open a file from a sub folder on a drive that I disconnect frequently, then close its own program. Everything works fine at this point.

How would I setup an error message within the batch file if the file on the drive can’t be found?