'Delete all file/directories from each subfolder windows shell
I have a question, I have the following paths:
C:\Vendita\folder1\files and subfolders
C:\Vendita\folder3\files and subfolders
C:\Vendita\folder3\files and subfolders
I want to delete (using win shell commands), for each subfolder (C:\Vendita\folder1,C:\Vendita\folder2,C:\Vendita\folder2...) all files and subfolders, but keeping folder1, folder2 ecc...
I try this:
for %D in (C:\Vendita\) do del *.* /s /q
but it deletes all files and keeps all subfolders.
Can you explain me what is wrong?
Thank you
Solution 1:[1]
Why don't you use rmdir
? Your command only removes files with a certain filename.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Dominique |