Duplicate File Detective provides a command-line interface that you can use to schedule project execution or integrate with an existing file management process.
Command line instructions (known as arguments) are passed in using a specific syntax which must be followed carefully. Here's an example:
dfd.exe /project:"c:\temp\test-project.dfd" /html:"c:\temp\export.html" /exit
Note that the arguments passed to the command line actions are surrounded by quotes; this is a requirement, as it allows the argument to contain spaces and still be parsed correctly.
You can also access the Duplicate File Detective executable using an absolute path, which is generally what you'll want to do when creating batch files, etc. Example:
"C:\Program Files\Duplicate File Detective\dfd.exe" /project:"c:\temp\test-project.dfd" /exit
Notice how, in the example above, the path to the Duplicate File Detective executable is also contained in quotes. This helps to ensure that spaces in the path name are handled correctly by the Windows command interpreter.
Now a more complex example using some of the various project override options (discussed further below):
dfd.exe /project:"c:\temp\test-project.dfd" /csv:"c:\dupes.csv" /date /SkipZeroLengthFiles:"1" /MatchFileNames:"1" /MatchExts:"1" /MatchContents:"1" /HashZipFileContents:"1" /MatchHashType:"SHA1" /exit
Important: Use of command line options within Duplicate File Detective is project-oriented. You execute a project by providing its name to the Duplicate File Detective program executable. You must create and save a project to disk before you can execute it in this fashion. This is a very powerful concept which effectively provides you with access to every project setting from the command line.
Duplicate File Detective will terminate automatically after processing command line options. No switch is required for this purpose.
Available Command Line Switches
Core switches:
•/Project - Provides the full path to the Duplicate File Detective project file to execute. This flag is required; without it, all other command line options are ignored.
•/Date - Appends the current date to the specified export filename; this applies only when using the "/html", "/csv", or "/xml" flags. Allows for unique daily export filenames within the same parent folder.
•/SaveEvents - Specify a fully qualified text file path to which events will be logged.
•/LoadSettings - Specify the fully qualified path to a program settings file (see About Settings for details).
Export switches:
•/HTML - Exports the duplicate file results in HTML format when project execution completes.
•/CSV - Exports the duplicate file results in CSV (comma separated values) format when project execution completes.
•/XML - Exports the duplicate file results in XML format when project execution completes.
•/PDF - Exports the duplicate file results in PDF format when project execution completes.
•/XLSX- Exports the duplicate file results in MS Excel format when project execution completes.
•/Email - Emails the export file to one or more recipient addresses (separated by commas).
A wide range of project override switches are also available. These switches override the values contained in the project file you pass in via the "project" parameter (see above).
Project path overrides:
•/Search - Specify one ore more search (folder) paths (separated by pipe symbols) that will overwrite those contained in the project.
•/AddSearch - Appends one or more search (folder) paths (separated by pipe symbols) to those currently defined by the project.
•/Exclude - Specify one ore more exclusionary (folder) paths (separated by pipe symbols) that will overwrite those contained in the project.
•/AddExclude - Appends one or more exclusionary (folder) paths (separated by pipe symbols) to those currently defined by the project.
Search filter override syntax:
•/SearchMask:"mask"
•/MasksCaseSensitive:[1|0]
•/MasksCompareFullPath:[1|0]
•/SearchSystemFolders:[1|0]
•/SearchHiddenFilesFolders:[1|0]
•/SkipZeroLengthFiles:[1|0]
•/SearchSubFolders:[1|0]
•/NameLenCountFullPath:[1|0]
•/UseRegex:[1|0]
•/ExcludeProtected:[1|0]
•/SizeMatchType:[none|small|medium|large|atleast|atmost|between]
•/FileSizeKb:[numeric]
•/FileSizeKbUpper:[numeric]
•/DateMatchType:[none|week|month|year|lastmod|created|accessed]
•/FromDate:"12/25/2016"
•/ToDate:"12/26/2016"
•/NameLenMatchType:[none|greater|less|equal|between]
•/NameLenLower:[numeric]
•/NameLenUpper:[numeric]
Comparison option override syntax:
•/MatchFileNames:[1|0]
•/MatchExts:[1|0]
•/MatchFileSizes:[1|0]
•/MatchLastMod:[1|0]
•/MatchContents:[1|0]
•/MatchBytes:[1|0]
•/MatchHashType:[CRC32|ADLER32|MD5|SHA1|SHA256|SHA512]
•/NormalizeFileNames:[1|0]
•/MusicTagsToMatch:[title|artist|album|track|year|genre|duration|bitrate]
•/MatchMusicTags:[1|0]
•/AlwaysExtractMusicTags:[1|0]
•/HashZipFileContents:[1|0]
•/HashZipFilePwd:"password"
•/MatchParentFolders:[1|0]
•/MatchParentFolderDepth:[1|0]
•/SkipNumbersInFileNames:[1|0]
Tip: To schedule the execution of a Duplicate File Detective project, first create a batch (.bat) file that calls the Duplicate File Detective executable with the correct command line arguments. Then use the integrated Windows scheduler to invoke the batch file on a scheduled basis.