I am trying to find way to break / exit from FOR loop, if there are any error occured. Below is content of batch file.
@echo on set myfile=D:\\sample.txt F
You don't need to call a label
set USBDRIVE=SETLOCAL set exit=ENABLEDELAYEDEXPANSION FOR %%D IN (C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO ( DIR %%D:\SOURCES\INSTALL.WIM > nul 2>&1 && call set USBDRIVE=%%D: && call set exit=1 if defined exit goto :dd3 ) :dd3