Variables in the Command Line action

Publish

Platform_KC
On Premises

When you use the <

Add the variable to the command line path:

Use the <

To create a command line action using a variable:

  1. Open the Publishing Profile and choose the Actions tab.
  2. Choose Command Line. The Command Line dialog box opens.
  3. Enter a name for the action in the Description field.
  4. Enter the <

    <SYS_PUBLISH_FOLDER>\[batchfile name].bat

  5. Add the variable to the Arguments field, enclosed in quote marks.

    Command Line Variable

  6. Save your changes to the Command Line dialog box.
  7. Add the batch file as an additional file in the publishing profile's Theme tab or the book properties Web tab.
  • Reference the argument in the batch file.
    1. Use the following code to reference the variable argument in the batch file:
  • Add the batch file as an additional file.
    • Make sure you include the batch file as an additional file in the publishing profile‚Äôs Theme tab or the Book object's Web tab.

CHDIR /D %[argument number]

  • CHDIR /D changes the location to the directory referenced in the argument. For the change directory code ensure you use CHDIR and not CD.
  • The switch /D changes drive, if required, to access the publishing folder.
  • %[argument number] resolves to the argument listed in the Command Line dialog box Arguments field, for example the publishing folder for that book.

    Note: Each argument in the Command Line dialog box must be referenced in the batch file. Reference the first argument as %1, the second argument %2, etc.