@echo off
SET path=%cd%
REM if exist %path%\bin\*.sh del /s /q %path%\bin\*.sh
REM if exist %path%\bin\*.original del /s /q %path%\bin\*.original
REM del /s /q %path%\bin\*.tar.gz
if exist %path%\bin\*.log del /s /q %path%\bin\*.log
REM if exist %path%\conf\*.original del /s /q %path%\conf\*.original
del /s /f /q %path%\logs
del /s /f /q %path%\temp
if exist %path%\webapps\*.war del /s /f /q %path%\webapps\*.war

for /F "delims=" %%i in ('dir /b %path%\work') do rmdir "%path%\work\%%i" /s/q

for /F "delims=" %%i in ('dir /b %path%\webapps') do (
  if NOT "%%i"=="docs" (
    if NOT "%%i"=="host-manager" (
      if NOT "%%i"=="manager" (
        if NOT "%%i"=="ROOT" rmdir "%path%\webapps\%%i" /s/q
      )
    )
  )
)

if EXIST %path%\wtpwebapps (
  rmdir "%path%\wtpwebapps" /s/q
)

echo Finished cleaning up %path% folder.
pause