M
Mark Berry
Hi,
This seems like it should be an easy task, but I don't see an easy solution.
What command can I run from the command line to delete all the files and
subfolders in a folder, without deleting the folder itself?
DEL /S /Q *.* will delete all the files but not the subfolders
RMDIR /S /Q *.* does not work
I know I could go up one level and use RMDIR on the folder itself, but I
want the folder to remain (with its custom permissions).
Is there no solution short of writing a script to loop through the
subfolders?
Background: an IP camera uses recording software to store images in a
folder. It creates its own hierarchy within a specified folder, based on
date and time. Since the image files use a lot of disk space, I want to
automatically delete them after I back them up to tape. However, the
top-level folder must remain so the camera software can continue saving
files.
Thanks for any tips,
Mark Berry
This seems like it should be an easy task, but I don't see an easy solution.
What command can I run from the command line to delete all the files and
subfolders in a folder, without deleting the folder itself?
DEL /S /Q *.* will delete all the files but not the subfolders
RMDIR /S /Q *.* does not work
I know I could go up one level and use RMDIR on the folder itself, but I
want the folder to remain (with its custom permissions).
Is there no solution short of writing a script to loop through the
subfolders?
Background: an IP camera uses recording software to store images in a
folder. It creates its own hierarchy within a specified folder, based on
date and time. Since the image files use a lot of disk space, I want to
automatically delete them after I back them up to tape. However, the
top-level folder must remain so the camera software can continue saving
files.
Thanks for any tips,
Mark Berry