hello,
I would like to know if there is a function to delete empty folders.
Thanks in advance.
delete empty folders
- Posts: 2
- Joined: 14 Jun 2022
- Posts: 4055
- Joined: 11 Jun 2019
Not is FFS. You can use a really easy robocopy command though.
Open a command prompt, navigate to the root folder, and run:
robocopy /move /s /R:0 /W:0 .\ .\
This "moves" all the data from '.\', which is the current folder you are in, to '.\', also the current folder you are in obviously. Adding the '/s' tells it to skip empty folders, thus deleting the from the "source", which is the current directory. This will most likely update the modification times of the folders, but the files will be intact.
Open a command prompt, navigate to the root folder, and run:
robocopy /move /s /R:0 /W:0 .\ .\
This "moves" all the data from '.\', which is the current folder you are in, to '.\', also the current folder you are in obviously. Adding the '/s' tells it to skip empty folders, thus deleting the from the "source", which is the current directory. This will most likely update the modification times of the folders, but the files will be intact.
- Posts: 1037
- Joined: 8 May 2006
OK, I'm wrong.I do NOT think you want to do that.robocopy /move /s /R:0 /W:0 .\ .\
I believe xCSxXenon misread the question.
(I might be wrong, but better to be wrong then sorry.)
That does look to work.
(Now let me think about that some...)
- Posts: 1037
- Joined: 8 May 2006
(For Windows...)
I've not used this in a long time, but... Remove Empty Directories (aka RED).
Everything: Remove Empty Directories
I've not used this in a long time, but... Remove Empty Directories (aka RED).
Everything: Remove Empty Directories
- Posts: 4055
- Joined: 11 Jun 2019
Nope, I read it correctly. Feel free to test the command on your own, it works perfect. I daily it at my job
- Posts: 1037
- Joined: 8 May 2006
Directory dates look to be maintained.This will most likely update the modification times of the folders
Oddly /e looks to give the same results as /s (i.e. the empty directories are removed?/s
Right. (I corrected myself above.)Nope, I read it correctly. ... it works
OK, that's nifty :-).
- Posts: 2
- Joined: 14 Jun 2022
Thank you for the answer.
But she lacked information.
I use the mirror function.
I have files that are manually moved from the source.
For the target, the files are deleted but not the folders
Thanks in advance
But she lacked information.
I use the mirror function.
I have files that are manually moved from the source.
For the target, the files are deleted but not the folders
Thanks in advance
- Posts: 4055
- Joined: 11 Jun 2019
What does any of that mean or have to do with deleting empty folders?
- Posts: 26
- Joined: 21 Mar 2023
I believe I may be able to translate.
The OP has some folders which contain files. He deletes some of the files which, on occasion, leaves an empty folder.
When he Mirrors the files onto the target the copies of the (deleted source) files are deleted but not the folders which once contained them.
The OP has some folders which contain files. He deletes some of the files which, on occasion, leaves an empty folder.
When he Mirrors the files onto the target the copies of the (deleted source) files are deleted but not the folders which once contained them.
- Posts: 1037
- Joined: 8 May 2006
See if this relates to your situation - if size or time filters are set:
Is FFS supposed to copy empty folders on update/mirror?
Is FFS supposed to copy empty folders on update/mirror?