A command line that accepts a text file containing a list of files to convert, or a list of files provided on the command line, and converts all files using Document Conversion Service. The Document Conversion Service must be running, either locally or on a remote computer for the file to be converted. If it is not running the command will return immediately with an error.

 

DCSConvertFileList /P=profile [/S=save location] [/O] [/NE] [/L]

                   [/E=extension map]

                   [/C=remote computer name;remote scratch folder] 

                   [/D="name:value"] [/W=wait time]

                   [/FAIL=failed results log file location] [/SIL=conversion log file path] 

                   [/I=input text file path] 

                   [/T=alternate temp folder]

                   "file[;save location]" "file[;save location]"...

 

Sample Command Lines

Convert all files on command line to TIFF images:

DCSConvertFileList /P="TIFF 200dpi Monochrome.xml"

                   "C:\Input\File1.doc" "C:\Input2\File2.doc"

Sends the files C:\Input\File1.doc and C:\Input\File2.doc to Document Conversion Service to be converted using the settings contained in the conversion profile TIFF 200dpi Monochrome.xml.

The converted files, File1.doc.tif and File2.doc.tif, will each be saved in the same location as their source file.

If a file with the same name already exists, that file conversion would fail. The results log file, named based on the source file and ending with .doc.failed.dcsresults would be placed in a folder named .failed created in the same location as the source document. This can be controlled with the /FAIL switch.

To overwrite an existing file the /O switch would need to be added to the above command. If you did not want the source file extension as part of your file name, the /NE switch would need to be added.

 

Convert all files on command line to TIFF images in their own directory:

DCSConvertFileList /P="TIFF 200dpi Monochrome.xml" "C:\Input\File1.doc;C:\Output1"

                   "C:\Input2\File2.doc;C:\Output2"

Sends the files C:\Input\File1.doc and C:\Input\File2.doc to Document Conversion Service to be converted using the settings contained in the conversion profile TIFF 200dpi Monochrome.xml.

The converted file, File1.doc.tif will be saved to the directory C:\Output1 and File2.doc.tif will be saved in the directory C:\Output2.

If the output directory does not exist, or if a file with the same name already exists in either directory, that file conversion will fail. The results log file, named based on the source file and ending with .doc.failed.dcsresults would be placed in a folder named .failed created in the same location as each source document. This can be controlled with the /FAIL switch.

To overwrite an existing file the /O switch would need to be added to the above command. If you did not want the source file extension as part of your file name, the /NE switch would need to be added.

 

Convert all files in the input file to TIFF images in a specific location:

DCSConvertFileList /P="TIFF 300dpi OptimizedColor.xml" /S="C:\Test\Output"

                   /I="C:\Test\Files.txt"

Sends the files listed in the text file Files.txt to Document Conversion Service to be converted using the settings contained in the conversion profile TIFF 300dpi OptimizedColor.xml.

Upon successful conversion each output file is placed under the C:\Test\Output folder.

If a file with the same name already exists, that file conversion would fail. The results log file, named based on the source file and ending with .doc.failed.dcsresults would be placed in a folder named .failed created in the same location as the source document.

 

Convert a list of files to vector PDF, strip off the source extension and save the output and results log files to a specific location:

DCSConvertFileList /P="Adobe PDF Multipage.xml" /NE /S="C:\Test\Output" /L

                   /FAIL="C:\Test\FailedLogs\\" /D="UseDateTimeInFailedFolder:FALSE"

                   /I="C:\Test\Files.txt"

Creates a PDF file from each file listed in the input file Files.txt. The PDF created is a vector PDF as controlled by the settings in the conversion profile Adobe PDF Multipage.xml.

Upon successful conversion each output file is placed under the C:\Test\Output folder along with the conversion results log file. The name of the results log file is based on the original source file and also indicates the conversion status. For example, if the source file name was SampleDocument.doc, a results log file, SampleDocument.doc.succeeded.dscresults, will be created if the conversion succeeds.

The /NE flag causes the output file to be named using the base name of the original file, plus the extension of the file type you are creating. If a file of that name already exists in the folder the conversion will fail. If the conversion fails a results log file named based on the source file and ending with .failed.dcsresults is placed into the folder C:\Test\FailedLogs\ specified by the /FAIL parameter. The /D setting UseDateTimeInFailedFolder disables the date and time subfolder creation under the failed logs folder.

Note: The double ending backslash used when specifying the folder for the /FAIL switch is required for the command line path to be parsed correctly.

 

Command Line Arguments

Command line switches are not case-sensitive and can be entered in either upper or lower case.

/S - The Save Location

Pass in the full path to the folder in which to save the new files. If the save location is not specified the new file is created in the same folder as the source file. If the files listed in the input file text file specified with the /I switch also include save locations, those locations will be used instead.

If the path includes spaces it must be enclosed in quotes.

If the path doesn't exist, the conversion will fail.

If a file of the same name already exists in the save file location, the conversion will fail. The /O option can be used to enable file overwriting, which is off by default.

 

Example:

/S="C:\Converted Files\Test"

 

/O - Overwrite Always

Enables overwrite mode so that existing files of the same name are overwritten with the new file. If the overwrite switch is not specified, the conversion of that file in the list of files will fail if a file of the same name already exists in the output folder.

 

/NE - No Extension

If you do not want the original file name extension as part of your output file name, use this switch to remove the file extension.

 

/L - Results Log

The results log file is an XML file containing a complete snapshot of the conversion information. Normally only saved for failed conversions, the /L argument enables creation of the results log file when the conversion succeeds. The results log file is placed in the same location as the converted files.

The name of the results log file is based on the name of the original file and also indicates the conversion status. For example, when converting Document.doc, a successful conversion will create a log file named Document.doc.succeeded.dcsresults, while a failed conversion would be named Document.doc.failed.dcsresults.

The results log file for a successful conversion is always copied to the output location with the converted files when this flag is used.

In the case of a failed conversion, the log file is always created. See the /FAIL switch to control the location and creation of the failed results log files.

The result log files can later be passed to the DCSExtractResults command line utility to extract information such as all files created or any errors encountered during conversion. You can search a folder for the results log files using the DCSCreateFileList utility.

 

/FAIL - Failed Results Log File Location

In the case of a failed conversion, the conversion results log file is always created. The default behavior is to create a .failed folder in the same location as the source file and save the conversion results log file to a new subfolder under the .failed folder. The subfolder is named using the date and time of the conversion to keep subsequent runs separate.

This argument allows you to override the default use of the .failed folder and to provide a specific folder in which to store the failed results log files. The name of the results log file is based on the name of the original file and also indicates the conversion status. For example, when converting Document.doc, a failed conversion would be named Document.doc.failed.dcsresults.

You can suppress the use of the date and time subfolder by passing the UseDateTimeInFailedFolder setting using the /D switch.

Note: The double ending backslash used when specifying the folder for the /FAIL switch is required for the command line path to be parsed correctly.

Examples:

/FAIL="C:\ConvertedFiles\Failed\\" /D="UseDateTimeInFailedFolder:FALSE"

 

If you do not want to create the failed results log files at all, you can use the /D switch to pass the KeepFailedItemResultsFiles setting as false.

On the command line:

/D="KeepFailedItemResultsFiles:False"

 

In a conversion profile:

<add Name="KeepFailedItemResultsFiles" Value="False"/>

 

The result log files can later be passed to the DCSExtractResults command line utility to extract information such the source file used or any errors encountered during conversion. You can search a folder for the results log files using the DCSCreateFileList utility.

 

/P - Conversion Profile

This is a required argument. The type of file created is controlled by supplying a conversion profile using this switch. The profiles are referenced by passing in the name of the profile XML file, with or without the XML extension. See Creating and Customizing Profiles for more information about the contents of the profiles, a list of profiles included with Document Conversion Service, and how to create your own.

Examples:

/P="TIFF 300dpi Color Fax"

/P="TIFF 204x196dpi Monochrome Fax.xml"

 

/D - Define Setting

Individual conversion and profile settings can be supplied on the command line using this switch. This switch can be specified multiple times for separate settings and any settings passed here will override the settings in the profile.

Any name-value pair that can be written in a profile can be passed through this parameter. This includes options to control the conversion settings as well as the behavior of the individual converters as well. See Creating and Customizing Profiles for more information about the name-value pairs that can be used.

Examples:

These first two are settings that control the converter options, such as what pages to print, and the output that PowerPoint will print.

/D="PrintRange:1-5"

/D="PowerPoint.PrintOptionsOutputType:PrintOutputNotesPages"

 

These two settings control the output file creation options, and would override or add to the settings in the conversion profile passed using the /P switch.

/D="Image Options;Fax Resolution:3"

/D="TIFF File Format;BW compression:Group3-2D"

 

These two settings control where the failed results log files are created and are most often used along with the /FAIL switch to control where the results log files are saved.

/D="KeepFailedItemResultsFiles:TRUE"

/D="UseDateTimeInFailedFolder:FALSE"

 

/E - File Extension Mapping

A file extension mapping profile uses the extension of the source file to determine what converter will be used to convert the file. Like the conversion profiles, this file is also an XML file. This switch is optional and an internal default mapping is provided. You would only need to provide this file if you wanted to override the default file extension to converter mappings provided.

Examples:

/E="Custom Extension To Converter Map"

 

/W - Wait Time

Use this switch wait to the specified number of seconds for the Document Conversion Service to be running and available to convert documents. If Document Conversion Service is already running the command executes immediately. If the Document Conversion Service is not running in the timeout period specified, the command will return with an error.

If this argument is not specified the command will return immediately with an error if Document Conversion Service is not running.

Example:

/W=300

 

/SIL - Smart Inspect Logging File

Smart Inspect Log files are a tracing of the entire conversion process and are not the same as the conversion results log files created when a conversion fails. These logs can be viewed using the SmartInspect Redistributable Console included with Document Conversion Service.

These log files are automatically deleted when conversion succeeds. To keep the log files on success use the custom setting AlwaysKeepProcessingLoggingFiles as shown below.

The default location for this file is the TEMP folder. Each logging file is assigned a unique date, time and thread prefix followed by "_PNConvertFileList.sil", such as 2014_09_11_2_38_00_PM_4_PNConvertFileList.sil.

Use this argument to specify a custom path and optional file name for the SmartInspect logging file (*.sil) created by this utility. The /SIL switch can take a folder, or a path to a filename. If a path without a trailing backslash is provided, the last part of the path is assumed to be a filename.

Note: The double ending backslash used when specifying a folder for the /SIL switch is required for the command line path to be parsed correctly.

/SIL=

Is interpreted as...

"C:\Test\LogFile"

Create the SmartInspect log file as C:\Test\LogFile.sil.

"C:\Test\LogFile\\"

Create the SmartInspect log file as C:\Test\LogFile\datetime_PNConvertFileList.sil

"C:\Test\LogFile\ConvertFileCustom.sil"

Create the SmartInspect log file as C:\Test\LogFile\ConvertFileCustom.sil

The following settings can be used to control the creation and naming of the logging file. These settings are all passed using the /D switch.

Custom Setting

Description

RemoveDateTimePrefixOnProcessingLoggingFiles

Pass True to disable the adding of the unique date, time and thread prefix when a custom file name has not been specified in the ConvertFileProcessLoggingPath parameter.

KeepFailedProcessingLoggingFiles

Pass as False to disable the automatic creation of SmartInspect logging files when conversion fails. This setting can be overridden by AlwaysKeepProcessingLoggingFiles.

AlwaysKeepProcessingLoggingFiles

When set to True, the SmartInspect logging files are always created in the %TEMP% or other specified folder for both successful and failed conversions. If set to False, no logging files are created. This setting will override the KeepFailedProcessingLoggingFiles setting.

Examples:

Pass a custom folder and remove the prefix, each run will overwrite the log file C:\PEERNET\Logs\PNConvertFileList.sil.

/SIL="C:\PEERNET\Logs\\" /D="RemoveDateTimePrefixOnProcessingLoggingFiles:TRUE"

 

Pass a custom folder and log file name and remove the prefix. Each run will overwrite the logging file C:\PEERNET\Logs\MyLogFile.sil.

/SIL="C:\PEERNET\Logs\MyLogFile" /D="RemoveDateTimePrefixOnProcessingLoggingFiles:TRUE"

 

Don't save any SmartInspect log files at all.

/D="AlwaysKeepProcessingLoggingFiles:FALSE"

 

/I - Input text file path

The collection of files to be converted can be passed as a text file containing a list of files, one each per line. Optionally you can specify individual save locations for each file by listing the file and directory, separated by a semi-colon(;) on each line. The full path or a UNC path to the source file and optional directory must be given for the files listed in the input text file and as command line arguments; relative paths are not supported.

The input text file should follow the following format:

C:\Input\WordFiles\File1.doc

C:\Input\WordFiles\File2.docx;C:\OutputPath\WordFiles\

C:\Input\PDF\File3.pdf;C:\OutputPath\PDFFIles\

\\server\share\Input\scans\scan1.tif

 

/C - Convert on a Remote Computer (DCOM)

If Document Conversion Service is running on a different computer, use this switch to pass the name of the remote computer and the path of a shared location that both computers have access to. Separate the name of the remote computer and the path to the shared folder location with a semi-colon.

When converting remotely, the client redistributable, PNDocConvClientSetup_3.0.exe, must be installed on the computer running this command line utility. The client setup install program is included as part of the Document Conversion Service install and can be found in the \Samples\Redist folder in your product installation folder.

Examples:

/C="DOCCONV_SERVER;\\DOCCONV_SERVER\DCSREMOTE"

 

/T - Alternate Temp Folder

This is an advanced setting that should not be needed in most cases. When converting files, the conversion tool copies each file and performs the conversion in temporary staging and working folders created on demand in the default Windows temp folder. When dealing with long path and file names the default folders created can occasionally cause path names that are too long to process. When this happens this switch can be used to set the temporary folder to a shorter path to allow processing.

This setting is overridden if the /C option for remote conversion is being used with its own path to a shared location for conversion.

Examples:

/T="C:\PNTemp\\"

 

/? - Display Help

When passed as the only argument this switch will display help for this command.

 

file[;save location]

The full path to the file to convert. You can list more than one on the command line. Like the input text file, you can pass in a semi-colon(;) separated file-directory pair here as well.

If the path to the file includes spaces it must be enclosed in quotes.

If the file doesn't exist, the conversion will fail.