- Jun
- 3
- 0
Hi there,
I've always believed and found that 4DOS/4NT/TCC have worked as per Microsoft's shells (COMMAND.COM then later CMD.EXE) where there is a corresponding command/option combination.
However, our production department just partially obliterated a server (deleting all files older than 30 days) and it seems they fell foul of a behaviour difference, which I'm trying to understand.
The production manager, as he is prone to do, Googled a problem: he wanted to delete all empty directories on the system over 30 days old. He found a one-line CMD.EXE script using FORFILES and which crucially used RMDIR.
FORFILES /p f:\ /S /D -30 /C "cmd /c IF @isdir == TRUE RMDIR /S /Q @path"
Now, he also Googled RMDIR and found sites commenting on the fact RMDIR won't delete directories with directories and indeed my later tests seemed to bear this out.
However, in practice running in TCC 16 without any aliases (he assures me I haven't been able to verify that yet) this did delete all directories older than 30 days irrespective of their containing files or not.
Right now I am trying to understand if my previous implicit assumption that TCC is 100% comparable to CMD.EXE where such comparability exists is plain wrong.
As a follow-up, does anyone have a suggestion as to how this requirement (delete empty directories older than 30 days) can be achieved safely?
Thanks.
I've always believed and found that 4DOS/4NT/TCC have worked as per Microsoft's shells (COMMAND.COM then later CMD.EXE) where there is a corresponding command/option combination.
However, our production department just partially obliterated a server (deleting all files older than 30 days) and it seems they fell foul of a behaviour difference, which I'm trying to understand.
The production manager, as he is prone to do, Googled a problem: he wanted to delete all empty directories on the system over 30 days old. He found a one-line CMD.EXE script using FORFILES and which crucially used RMDIR.
FORFILES /p f:\ /S /D -30 /C "cmd /c IF @isdir == TRUE RMDIR /S /Q @path"
Now, he also Googled RMDIR and found sites commenting on the fact RMDIR won't delete directories with directories and indeed my later tests seemed to bear this out.
However, in practice running in TCC 16 without any aliases (he assures me I haven't been able to verify that yet) this did delete all directories older than 30 days irrespective of their containing files or not.
Right now I am trying to understand if my previous implicit assumption that TCC is 100% comparable to CMD.EXE where such comparability exists is plain wrong.
As a follow-up, does anyone have a suggestion as to how this requirement (delete empty directories older than 30 days) can be achieved safely?
Thanks.