I have been using the beta version of Kix, 4.52 beta 2, because I wanted to use the updated RD command.
One thing I have noticed is that if I try to remove a directory it does not delete the folder I specify. It deletes all of the sub-dirs but not the root.
e.g. RD "R:\Folder" /S This will delete all sub-dirs but not the "folder" dir. Is this by design? I thought the whole point of RD was to delete the directory that you specify.
If you have a look at the commnets on the microsoft RD command. "Removes all directories and files in the specified directory in addition to the directory itself. Used to remove a directory tree."
What I am after is the "in addition to the directory itself" part.
NTDOCNTDOC Administrator
Registered: 2000-07-28
Posts: 11625
Loc: CA
I reported similar but a little different behavior already. I think it is in the parse routine, either Ruud is trying to save us from ourselves - I hope not or the path information supplied is just not being correctly read / parsed. Hopefully this will be fixed in Beta 3
If I run the same command with a subfoler I get the same error. If I run the same command with a text file in the folder it deletes the folder and returns a success
If the subfolder has a folder which has other folders and files it still returns an error.
I get the same result for both local and network drive. I haven't tried it on a share.
NTDOCNTDOC Administrator
Registered: 2000-07-28
Posts: 11625
Loc: CA
it removes empty folders for me further down the path as long as the folder that was set to be removed has a file in it. If the folder that is set to be removed DOES NOT have a file in it then the whole operation will fail regardless of file depth. The KEY to it working or not is if the folder set to be removed has any files in it or not.
RD "C:\TEMP\TEST\John" /s And the folder is like this below... If Data or Folders or Finance is blank or has files doesn't matter. If the folder John has at least a single file it in the whole structure will be removed. If John has no files and the other folders do have files the whole operation will fail.
C:\TEMP\TEST\John\Data\Folders\Finance
No, Ruud did not respond yet that I'm aware of, but he doesn't always respond. Often he just fixes it and tells us about it.
Arend_Arend_ MM club member
Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
I've tested this trough and trough what I find is that the /S switch works fine as long as there are subfiles and folders in the folder you are trying to delete. Everything gets deleted. But if you specify the /S switch on an empty folder you get an error, which in turn will get deleted if you don't specify the /S switch.
(edit) after reading NTDOC's last message, I basically said what he said...
NTDOCNTDOC Administrator
Registered: 2000-07-28
Posts: 11625
Loc: CA
Further testing of RD shows that it does not support a UNC path structure with spaces.
A typical UNC might be something like this:
\\Computer\c$\Documents and Setting\JohnDoe
There does not appear to be a valid method to DYNAMICALLY reduce or use UNC with spaces in the path.
Would like to request RD be updated to support UNC mechanism with spaces in the UNC path somehow, or some method to DYNAMICALLY properly shorten the path for use.