The Batch file properties frame

CloneSpy

The Batch file properties frame


This frame is for specifying a batch file which is used if you select the option Defer deletion to batch file in the On automatic deletion frame in the Main window. Moreover, the structure of the batch file can be defined in this frame.

The radio buttons Append data, Replace file, and Make new file have the same functionality as the buttons in the Log file frame.

In the File edit box you can specify the batch file which is used to export data about targeted files. You may use the Browse button for selecting a file from your system. If you enter a file path directly to the edit box the entry must fulfill the requirements described in the section Specifying paths.

The Encode drop-down list box allows you to choose the encoding of the batch file to be produced. You can choose between ANSI, OEM, Unicode, and UTF-8. Both OEM and ANSI code pages are extended ASCII code pages where characters are represented by one byte. The ANSI code page refers to characters used in Windows itself (default option) while the OEM code page is used in the Windows' console (e.g., for batch files). Unicode characters are represented by two bytes. UTF-8 is a variable-width encoding using one to four bytes per character. Choose Unicode or UTF-8 encoding if your files contain non-Latin characters. If you choose ANSI or OEM encoding instead then it can happen that certain Unicode characters cannot be represented in the corresponding code page. In this case the default character selected in the Default character drop-down list is used. This drop-down list offers three options:
  • The character "?" is a wildcard. It allows the batch process to find the corresponding file even if the original character cannot be represented using the given encoding. This option is not recommended because you can accidentally delete multiple files with similar names. This happens if file names only differ in those characters which are replaced by "?" characters.


  • The characters "|" and ":" will cause an error when a file operation is executed. Therefore no operation will be performed on the corresponding file.
The structure which will be created in the specified batch file has to be defined in the Format edit box. For every targeted file one line corresponding to the format will be written to the batch file. In order to include information about handled files please use the patterns from the following table. All other characters entered to the Format line will simply be written to the batch file.

   Files targeted 
for deletion
 Corresponding file 
to be retained
Size: %ds %rs
Name: %dn %rn
Path: %dp %rp
Folder: %df %rf
Time: %dt %rt
Attributes: %da %ra

For more information on the individual patterns please refer to the Export list properties frame.

The option Convert file name, file path, and folder path to short form (8.3 form) is helpful if your file paths contain non-ANSI characters. Those characters can only be represented in a batch file if it is encoded in Unicode or UTF-8. However, Windows' standard Command Prompt cannot execute those batch files. Since the 8.3 form contains only ANSI characters, Windows' standard Command Prompt can handle it. Please note that Windows may not provide an 8.3 form for certain file or folder names, because this mechanism is disabled for a specific volume. The second line of the option shows how this mechanism is configured on your system. Please also note that this mechanism can be disabled at any time. Therefore, it is possible that for some file or folder names the 8.3 form exists and for some others on the same volume not. The drop-down list box allows you to select a fallback action in case a file or folder name cannot be converted into the 8.3 form. You can either choose to use the original (long) name or to skip writing the affected entry into the batch file.

Notes:
  • The option to defer file deletion to a batch file is only possible if you select an Automatically delete option in the Action frame in the Main window. This ensures that at least one file of a set of equal files is retained. One of those files is chosen to be the one which is used for the %r patterns while all other files are scheduled for deletion or another file operation, respectively.


  • Batch files encoded in Unicode or UTF-8 cannot be executed by Windows' standard Command Prompt. You might need to use another shell to execute those batch files.


  • Zero length files are handled as defined in the Zero length files frame.