@echo off del \\8.8.8.8\dir\IN_ok\*.* /S /F /Q SET Path2Del=\\8.8.8.8\dir\IN_ok\ for /R "%Path2Del%" %%F in (.) DO IF NOT "%%F"=="%Path2Del%." (RD /S /Q "%%F") ELSE (Del /F /S /Q "%Path2Del%*") echo Vse vremennyie faylyi i papki udaleny pause @echo ON