deleting contents of folder
Hi,
How do I remove the contents of a folder, without removing the folder itself.
Archive: deleting contents of folder
deleting contents of folder
Hi,
How do I remove the contents of a folder, without removing the folder itself.
Use Delete Folder\*.*?
Stu
hi
thanks for your reply
i tried this, but this also removes the folder,
for example, i want to remove all files and folders in the following folder:
c:\temp\files\
but i dont want to remove the 'files' folder, i just want to keep that empty
Does anyone know how to do this?
Just trying to empty a directory, with deleting the folder
Simplest would be completely removing the folder and then recreating it.
o_O
delete "c:\temp\test\*.*"
I'm thinking maybe the folder gets deleted because it's in Temp? That's assuming C:\temp is the Temp folder. At least I don't see any other reason why it'd disappear...
thanks for the replies
I think I will try going for the FindFirst, FindNext, FindClose method, since there are folders inside the directory that I want to clean, and Delete C:\folder\folder\*.* does not remove any folders that are inside the directory, only files.