Command line parameters

CloneSpy

Command line parameters
The usage of CloneSpy is:

  CloneSpy [-a [<settings file>] [-e|-i]]
           [(-c1|-c2) <CSC-file> [-e|-i]]
           [-csc <CSC-file(s)>]
           [-m1|-m2|-m12|-m1c|-m2c]
           [(-p1|-p2) (<pool file>|<text file>|<folder(s)>)]
           [-u]


-a

If you call CloneSpy with this parameter then the scanning process will be started right after the program's window appears. To make use of this option, CloneSpy should be configured to automatically read a settings file when it starts. Otherwise the scanning process cannot be launched. In order to load a settings file when the program starts please have a look at the Automation window.


-a <settings file path>

This way CloneSpy will also perform an autostart as in the -a case above. But if you provide a settings file path, the program does not need to be configured to automatically load a settings file when it starts. Moreover, if this is enabled in the Automation window then the selection of the settings file will be overridden by the file specified in the command line. Important to mention is that a file path must be quoted if it contains free space characters, as in the following example:

  CloneSpy -a "C:\Program files\CloneSpy\Default.cst"

Note: If a settings file path is specified in the command line then the settings are not automatically saved on program exit to the file specified in the Automation window, even if this option is activated. This procedure prevents CloneSpy from accidentally overwriting the standard settings file by the settings file given in the command line. If you want to save the settings even though, you have to do it manually (see the menu of the Main window).


(-c1|-c2) <CSC-file path>

If you add -c1 to the command line followed by a CSC-file path CloneSpy will create the specified CSC-file from the content of pool 1 right after the program's window appears. The same holds for -c2 and pool 2, but -c1 and -c2 cannot be used at the same time. Similar to the -a option the corresponding pool must not be empty for this operation (see -a, -p1, -p2). Each of the options -c1 and -c2 can be used together with -a <settings file> to load a specific settings file. In this case the -a option will not start a normal scan, i.e., -c1 and -c2 overrule -a. If the specified CSC-file already exists it will be overwritten.


-csc <CSC-file path(s)>

This option allow you to replace the content of the CSC-pool with one or more specified CSC-files at program start. If CloneSpy is configured to automatically read a settings file when it starts (see Automation window) or if a settings file is specified by the -a parameter (see above), then the CSC-pool is modified afterwards. The arguments taken by the -csc option have to fulfill the requirements described in the section Specifying paths.


-e

This parameter can only be used in combination with the -a, -c1 and -c2 parameter. It makes CloneSpy to close itself when the automatically started scan or CSC-file generation is finished. In combination with -a this option is intended to be used if either duplicates are processed automatically or the result of the scan is exported (see the Action frame in the Main window). To ensure unattended operation of the program in this case, you have to adapt your settings in the Options window accordingly:
In addition, errors should be suppressed (see the Ignore errors frame in the Report page in the Options window). This can also be achieved by using the -i instead of the -e parameter.


-i

This parameter causes the same effect as the -e parameter. In addition it suppresses error messages that might appear when starting a scan. For example, if a pool cannot be scanned because the contained folder is empty, then no error message is shown. In such cases CloneSpy simply closes itself without executing the scan.


-m1 -m2 -m12 -m1c -m2c

These five options allow you to override the setting of the Mode frame in the Main window. The options set the mode to Compare files within Pool 1, Compare files within Pool 2, Compare Pool 1 to Pool2, Compare Pool 1 to CSC-file(s), and Compare Pool 2 to CSC-file(s), respectively. If the mode is changed by one of these options and CloneSpy is closed afterwards, then the modified mode is stored to disk if the auto-save option is activated (see Automation window). However, the CloneSpy settings are not saved if they are specified by the -a parameter (see above).


(-p1|-p2) (<pool file path>|<text file path>|<folder path(s)>)

The options -p1 and -p2 allow you to override the content of the pools at program start. If CloneSpy is configured to automatically read a settings file when it starts (see Automation window) or if a settings file is specified by the -a parameter (see above), then the pools are modified afterwards. The arguments taken by the two options can be a combination of CloneSpy pool file paths, special text file paths, and folder paths.
  1. If a CloneSpy pool file (*.csp) should be used to overload, e.g., pool 1 (-p1), then CloneSpy has to be started as in the following example:

      CloneSpy -p1 "C:\Program files\CloneSpy\MyPool.csp"

    If the pool file specified in the command line cannot be found, CloneSpy presents an error message. Otherwise the initial pool content is replaced by that residing in the given pool file. See the Add folder window on how to create a CloneSpy pool file.


  2. If the given argument is a text file (*.txt), then the file is analyzed. CloneSpy assumes that the file contains a list of folder paths (or drives). Each folder path has to be in a separate line. As an example consider that the file MyFolderList.txt contains the following lines:

      C:\TestThis
      D:
      C:\MyData\AnotherFolder\


    If you want to load this list to, e.g., pool 2 (-p2), then CloneSpy has to be started as in the following example:

      CloneSpy -p2 "C:\Text documents\MyFolderList.txt"

    If the specified text file cannot be found, then CloneSpy will show an error message. Otherwise the initial pool content is replaced by the folders specified in the text file. If a line in the file does not describe an existing folder (or drive), then the line is ignored. This way specific lines can easily be commented out by, e.g., putting a # in front of them. If there is no valid folder in the text file at all, then the corresponding pool will end up to be empty.

    Moreover, if the specified text file contains entries that conflict with each other, then these conflicts are resolved. For example, consider that following list is used to modify a pool:

      C:\
      C:\TestThis


    Both entries cannot be added to the pool, because the second folder is a sub-folder of the first one. If something like this happens, then only the sub-folder is inserted in the pool. Thus, only the second line of the example above is inserted. This way CloneSpy tries to make sure that not too many files are scanned by mistake.


  3. If the argument is a folder path or a drive, then CloneSpy checks whether it exists or not. All existing folders and drives will used to replace the initial content of the corresponding pool. If a folder or drive does not exist, an error message is shown. For example, the argument may be something as:

      C:\TestThis

    or:

      C:\MyData\AnotherFolder\

    Again important to mention is that a specified path must be quoted if it contains free space characters. But in this case be careful if the path might also end with a backslash as in the following example:

      "C:\MyData\Yet Another Folder\"

    The argument above will not be correctly given to CloneSpy, because the sequence of backslash and quotation mark will be interpreted by Windows as a so-called escape sequence. This means that the second quotation mark will not terminate the argument but become part of the argument instead. This problem can be solved by escaping the final backslash with an additional backslash as in the following example:

      "C:\MyData\Yet Another Folder\\"

    or by inserting a white space character after the final backslash as in this example:

      "C:\MyData\Yet Another Folder\ "
Notes:
  • If an argument matches neither of the cases above, then an error message informs you that the argument cannot be used to modify the corresponding pool.


  • If a pool is overloaded and the new content conflicts with the content of the other pool (e.g., a folder to be inserted in pool 1 already exists in pool 2), then the conflicting entries of the other pool are removed automatically.


  • If a pool is modified successfully and CloneSpy is closed afterwards, then the modified pool is stored to disk if the auto-save option is activated (see Automation window). However, the CloneSpy settings are not saved if they are specified by the -a parameter (see above).

-u

This parameter deactivates the automatic check for new versions on program start. If the update check is already deactivated, then this parameter is silently ignored.


Notes:
  • Default command line parameters for CloneSpy can also be specified in the registry at:

      HKEY_LOCAL_MACHINE\SOFTWARE\CloneSpy\CmdLineParams

    These parameters are ignored if any parameter for CloneSpy is given on the real command line.


  • If you want to configure more CloneSpy settings then you have to create a corresponding settings file and specify it using the -a parameter on the command line.