Skip to main content
added 216 characters in body
Source Link

The way i found to clean all files and subdirectories on a directory is to remove all files recursively with del as others already did, then use a for to remove each subdirectory:

del /s /q "C:\Path\to\directory\*"
for /d %a in ("C:\Path\to\directory\*") do rmdir /s /q "%a"

Tested on Windows 10, I think it will work on Windows 7.

If used inside a bat file, the % needs to be escaped and '%a' becomes '%%a':

REM Inside a .bat file:
del /s /q "C:\Path\to\directory\*"
for /d %%a in ("C:\Path\to\directory\*") do rmdir /s /q "%%a"

The way i found to clean all files and subdirectories on a directory is to remove all files recursively with del as others already did, then use a for to remove each subdirectory:

del /s /q "C:\Path\to\directory\*"
for /d %a in ("C:\Path\to\directory\*") do rmdir /s /q "%a"

Tested on Windows 10, I think it will work on Windows 7.

The way i found to clean all files and subdirectories on a directory is to remove all files recursively with del as others already did, then use a for to remove each subdirectory:

del /s /q "C:\Path\to\directory\*"
for /d %a in ("C:\Path\to\directory\*") do rmdir /s /q "%a"

Tested on Windows 10, I think it will work on Windows 7.

If used inside a bat file, the % needs to be escaped and '%a' becomes '%%a':

REM Inside a .bat file:
del /s /q "C:\Path\to\directory\*"
for /d %%a in ("C:\Path\to\directory\*") do rmdir /s /q "%%a"
added 3 characters in body
Source Link

The way i found to clean all files and subdirectories on a directory is to remove all files recursively with del as others already did, then use a for to remove each directorysubdirectory:

del /s /q "C:\Path\to\directory\*"
for /d %a in ("C:\Path\to\directory\*") do rmdir /s /q "%a"

Tested on Windows 10, I think it will work on Windows 7.

The way i found to clean all files and subdirectories on a directory is to remove all files recursively with del as others already did, then use a for to remove each directory:

del /s /q "C:\Path\to\directory\*"
for /d %a in ("C:\Path\to\directory\*") do rmdir /s /q "%a"

Tested on Windows 10, I think it will work on Windows 7.

The way i found to clean all files and subdirectories on a directory is to remove all files recursively with del as others already did, then use a for to remove each subdirectory:

del /s /q "C:\Path\to\directory\*"
for /d %a in ("C:\Path\to\directory\*") do rmdir /s /q "%a"

Tested on Windows 10, I think it will work on Windows 7.

added 3 characters in body
Source Link

The way i found to clean all files and subdirectories on a directory is to remove all files recursively with del as others already did, then use a for to remove each directory:

del /s /q "C:\Path\to\directory\*"
for /d %a in ("C:\Path\to\directory\*") do rmdir /s /q "%a"

Tested on Windows 10, I think it will work on Windows 7.

The way i found to clean all files and subdirectories on a directory is remove all files recursively with del as others already did, then use a for to remove each directory:

del /s /q "C:\Path\to\directory\*"
for /d %a in ("C:\Path\to\directory\*") do rmdir /s /q "%a"

Tested on Windows 10, I think it will work on Windows 7.

The way i found to clean all files and subdirectories on a directory is to remove all files recursively with del as others already did, then use a for to remove each directory:

del /s /q "C:\Path\to\directory\*"
for /d %a in ("C:\Path\to\directory\*") do rmdir /s /q "%a"

Tested on Windows 10, I think it will work on Windows 7.

Source Link
Loading