-1

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
user3439894
  • 7,266
  • 3
  • 17
  • 28
Fariba
  • 693
  • 1
  • 12
  • 27

1 Answers1

0

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 
)
Fariba
  • 693
  • 1
  • 12
  • 27