Batch exit if drive device not ready/unavailable -


I need to stop a batch file and exit the batch program (but not at the command prompt) if a drive / The device fails because it is not ready / unavailable.

I have tried ...

  d: || Exit / b  

... and I also tried ...

  If% ERRORLEVEL% NEQ 0 exit / b% error level%  

... after every line without success.

like this:

  if not present then d: exit / B  

Comments