Windows7 bash script, borrar directorios, fichero


@ECHO OFF
REM -----------------------------------------------------------------------
REM Borra una serie de directorios para que no tenga que hacerlos a mano
REM -----------------------------------------------------------------------

ECHO # process START at %date% %time% --------------------------------- >> C:Proyectosdepoi-networkspace_branchdeleteFiles.log
ECHO Eliminando carpetas y ficheros:
ECHO Eliminando carpetas y ficheros: >> C:Proyectosdepoi-networkspace_branchdeleteFiles.log

set folder="C:Softwareliferayliferay-portal-6.1.1-ce-ga2tomcat-7.0.27logs"
cd /d %folder%
for /F "delims=" %%i in ('dir /b') do (rmdir "%%i" /s/q || del "%%i" /s/q) >> C:Proyectosdepoi-networkspace_branchdeleteFiles.log

set folder="C:Softwareliferayliferay-portal-6.1.1-ce-ga2tomcat-7.0.27temp"
cd /d %folder%
for /F "delims=" %%i in ('dir /b') do (rmdir "%%i" /s/q || del "%%i" /s/q) >> C:Proyectosdepoi-networkspace_branchdeleteFiles.log

set folder="C:Softwareliferayliferay-portal-6.1.1-ce-ga2tomcat-7.0.27workCatalina"
cd /d %folder%
for /F "delims=" %%i in ('dir /b') do (rmdir "%%i" /s/q || del "%%i" /s/q) >> C:Proyectosdepoi-networkspace_branchdeleteFiles.log

rmdir /S/Q C:Softwareliferayliferay-portal-6.1.1-ce-ga2tomcat-7.0.27webappsfacturae-portlet >> C:Proyectosdepoi-networkspace_branchdeleteFiles.log

set folder="C:Softwareliferayliferay-portal-6.1.1-ce-ga2deploy"
cd /d %folder%
for /F "delims=" %%i in ('dir /b') do (rmdir "%%i" /s/q || del "%%i" /s/q) >> C:Proyectosdepoi-networkspace_branchdeleteFiles.log

set folder="C:Softwareliferayliferay-portal-6.1.1-ce-ga2logs"
cd /d %folder%
for /F "delims=" %%i in ('dir /b') do (rmdir "%%i" /s/q || del "%%i" /s/q) >> C:Proyectosdepoi-networkspace_branchdeleteFiles.log

set folder="C:UsersE01740AppDataLocalTemp"
cd /d %folder%
for /F "delims=" %%i in ('dir /b') do (rmdir "%%i" /s/q || del "%%i" /s/q) >> C:Proyectosdepoi-networkspace_branchdeleteFiles.log

set folder="C:WindowsTemp"
cd /d %folder%
for /F "delims=" %%i in ('dir /b') do (rmdir "%%i" /s/q || del "%%i" /s/q) >> C:Proyectosdepoi-networkspace_branchdeleteFiles.log

set folder="C:Proyectosdepoi-networkspace_branchfacturaefacturae-portletstarget"
cd /d %folder%
for /F "delims=" %%i in ('dir /b') do (rmdir "%%i" /s/q || del "%%i" /s/q) >> C:Proyectosdepoi-networkspace_branchdeleteFiles.log

REM -- set folder=""
REM -- cd /d %folder%
REM -- for /F "delims=" %%i in ('dir /b') do (rmdir "%%i" /s/q || del "%%i" /s/q)

ECHO # process END --------------------------------------------------- >> C:Proyectosdepoi-networkspace_branchpackageDeploy.log
echo "Puedes revisar el log para comprobar que todo se ha eliminado correctamente"
timeout /T 5

exit

Guardar como: borraLiferaProjectTemp.bat
Ejecutar como:
– con el raton pinchar dos veces
– en la consola de windows, (ir hasta el directorio que contiene el fichero), ejecutar: borraLiferaProjectTemp

Anuncios
Windows7 bash script, borrar directorios, fichero