Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Questions about DEDUPE Command

Jun
1,101
48
After some experimentation with DEDUPE, I think I understand how it works. Basically, it runs through all the specified directories, generating the hash codes for the files, and noting any duplicates and/or acting (if the /D. /H, or /L option is specified) on any duplicates found after the initial file. I have a couple of questions.
  1. Is there a reason why there is no option (e.g., /O) to specify the order in which the files are processed in each directory? I can imagine wanting to have DEDUPE remove the duplicates with the earlier or later time stamp or perhaps the earlier file name (e.g., keep file1.txt and delete duplicates file2.txt and file3.txt -- that's a case I actually encountered).
  2. I have a situation in which I would want to specify the /S option for some of the directories but not others. So I would have wanted a syntax like DEDUPE ... subdir1 /s subdir2 /s parentdir., with the option being placed after the directory name (or it could be before the directory but apply only to the one directory immediately following the option). In my case, subdir1 and subdir2 are subdirectories of parentdir, and I want to delete from the parent any files that have been copied into or otherwise duplicated in the subdirectory trees subdir1 and subdir2. If the /S option applied to parentdir, the subtrees would be processed again. (And what happens when the same file is processed a second time and is, of course, a duplicate of itself.)
 
1. Nobody has asked for this. It would also be slow and require a LOT of memory.

2. Nobody has asked for this, it would be complex to implement, and I suspect very few would want it if it was available. But you can post it to the Suggestions Forum and see if anybody else joins in.
 
OK, thanks. You answered #1: a good technical reason.

As for #2, I can probably do what I want using a batch script (with dedupe commands), so it's not that important. Probably safer in a script, per discussion to follow.

I would be interested in the answer to the question I asked at the end of #2. What if the same directories end up appearing more than once in the list of those scanned? Does the command keep track of directories that have been scanned and skip scanning a second time?

Hmmm. I just did an experiment, and the answer is no. The command dedupe /d * dir1 dir1 results in the deletion of all the files!!! That makes DEDUPE a little dangerous. I think that means that DEDUPE /d /s * subdir1 subdir2 parentdir would result in the deletion of all files in the subdir1 and subdir2 trees. Of course, any command that can delete files should be used with caution. It would be prudent to omit the /d option initially in order to see what would happen before doing any actual deletions.
 
DEDUPE is dangerous to the same extent that DEL or COPY or MOVE are dangerous. DEL /S can obliterate your system faster than DEDUPE; it's up to the user to use the power tools with care and not apply the sawzall to their neck. Trying to idiot-proof commands usually renders them annoying and/or useless.
 
Yes, agreed. That's what I wrote. Removing "duplicates", however, does not sound as obviously dangerous as deleting. And it's not as obvious what exactly DEDUPE is doing.
 
A suggestion: it would be nice to have a run-without-doing-anything mode to be able to see what duplicates it would find before it does things with them. Many CLI tools often have "/n" switch or something like it to indicate not to do the actual work. That would be a handy feature here.
 
I thought so, too, but then I realized that it already does that. Just run it with none of the options /D (delete), /H (convert to hard link), or /L (convert to symlink). Without those options, you just get a list with the original file that will be kept and, indented under it, the duplicates that would be processed.

It would be nice if the help made that clear.
 
@Jay Sage

Ahhh, and I checked the options earlier but didn't saw/realized that!

Thanks for pointing that out!
 
I, too, had looked for such an option. The only hint in the help is the initial statement: Search for and optionally delete or symlink duplicated files.
 
Back
Top