@echo off
@IF "%BATCH_ECHO%" == "on" echo %BATCH_ECHO%

rem Patch version: 9.4.0.0-343-patch5

GOTO :delete

:delete_old
PUSHD %1
  FOR %%F IN (%2) DO (
    IF NOT "%%F" == "%3" (
      echo Delete %1\%%F
      DEL %%F
    )
  )
POPD
GOTO :eof

:delete
CALL :delete_old lib kettle-core-*.jar kettle-core-9.4.0.0-343-6.jar
CALL :delete_old lib kettle-engine-*.jar kettle-engine-9.4.0.0-343-6.jar
CALL :delete_old lib kettle-dbdialog-*.jar kettle-dbdialog-9.4.0.0-343-6.jar
CALL :delete_old lib kettle-ui-swt-*.jar kettle-ui-swt-9.4.0.0-343-6.jar
CALL :delete_old lib javax.resource-api-*.jar javax.resource-api-1.7.1.jar
CALL :delete_old lib pentaho-solutions-*-mondrian.jar pentaho-solutions-26.1-mondrian.jar
CALL :delete_old lib postgresql-*.jar postgresql-42.7.10.jar
CALL :delete_old lib mariadb-java-client-*.jar mariadb-java-client-3.5.7.jar

CALL :delete_old plugins\mariadb pentaho-mariadb-*.jar pentaho-mariadb-9.4.0.0-1-kettle.jar

pause

EXIT /b 0
