Tag Archives: dir

Delete files and folders with long names in Windows

Using command line you can delete files and folders with long names:


Clear folder (subfolders and files) in BATCH

To delete all files and subfolders in given directory, you can use next snippet:

    @echo off  
    setlocal enableextensions enabledelayedexpansion  

    set pathDirToClear=C:\Tmp  
    for /d %%A in (%pathDirToClear%) do (  
        if exist %%A (  
            del /F /Q %%A\*  
            for /d %%B in (%%A\*) do (  
                rd /S /Q %%B