I would like to convert this code from sh file to .bat file, how can i do?
# Validate directories
if [ ! -d "$DIRA" -o \
! -d "$DIRB" -o \
! -d "$DIRC" ]
then
echo " invalid path"
exit 1
fi
I would like to convert this code from sh file to .bat file, how can i do?
# Validate directories
if [ ! -d "$DIRA" -o \
! -d "$DIRB" -o \
! -d "$DIRC" ]
then
echo " invalid path"
exit 1
fi
It can be written like this in .bat file:
rem validate directories
set VALID_PATH=true
IF NOT EXIST %DIRA%\NUL set VALID_PATH=false
IF NOT EXIST %DIRB%\NUL set VALID_PATH=false
IF NOT EXIST %DIRC%\NUL set VALID_PATH=false
if %VALID_PATH%==false (
echo invalid path
goto done
)