It is often convenient to a monitor a specific folder (called a “hot-folder”) and automatically process every
new file placed into it. This way there is no need to manually run any batch file or application,
the files are getting processed dynamically, as they are being placed into the “hot-folder”.

You need a copy of Adobe® Acrobat® along with the AutoSplit plug-in installed on your
computer in order to use this tutorial. Both are available as trial versions.

Overview

In this tutorial we will use the following files:

SplitProfile.apr - Auto-Split document splitting settings file.

HotFolder.BAT - a batch file that starts Adobe Acrobat and applies SplitProfile.apr to the input file.

WatchFolder.ps1 - a Powershell script that monitors a folder and runs HotFolder.BAT on each new file.

We will use these 3 files to monitor a folder and split every file that is copied into it.

Creating Splitting Settings File

Open a sample PDF document and select "Plug-ins > Split Documents > Split Document" from the menu.
Use any of the available splitting methods to configure a splitting job.
Refer to the step-by-step tutorials for
details on various splitting methods that are provided by the AutoSplit Pro plug-in.
Test the settings on a sample PDF file to make sure they work correctly and produce desired results.

It is a good idea to configure the settings to store output files into a different folder than the "hot-folder" one.
Placing the output files right into the hot-folder will trigger to splitting for each of them.

Once you have a working splitting settings, press "Save Profile..." button located on the main "Split Document"
screen to save them as SplitProfile.apr file..

BAT File Syntax

We would need to create a batch file that can accept path to the input file
as a parameter. This way the folder-monitoring script or application can
pass a filename that needs to be processed to the BAT file.
Use SET AUTOSPLIT_INPUT_FILE=%1 to specify the input filename. Note that
%1 refers to a first command-line parameter that is passed to the BAT file during the excution.

Here is the HotFolder.BAT file we are going to use.
It starts the Adobe Acrobat DC and applies "Split Document" operation to a PDF file that is
passed to it as a parameter:

SET AUTOSPLIT_INPUT_FILE=%1
SET AUTOSPLIT_CONFIG_FILE=C:\Data\SplitProfile.apr
SET AUTOSPLIT_BAT_ENABLE=ON
SET AUTOSPLIT_MODE=Split
SET AUTOSPLIT_LOG_FILE=C:\Data\HotFolder\AutoSplitLog.txt
"C:\Program Files (x86)\Adobe\Acrobat DC\Acrobat\Acrobat.exe" /n /h

Monitoring a Folder using a Powershell Script

There are many different ways to monitor a folder. We are going to show how to use a Powershell script to do that.
PowerShell is a task automation and configuration management framework from Microsoft,
consisting of a command-line shell and associated scripting language.
The script below is an adaptation of the method explained
in the following excelent online article. Refer
to this page for in-depth details and discussions on the Powershell programming methods.

Here is the Powershell script that monitors the c:\Data\HotFolder folder
and runs HotFolder.BAT file on every file that is placed into it.
Copy the following code into a text file and save it with *.ps1 file extension (for example: WatchFolder.ps1).
If you want to monitor a different folder or specify a different BAT file, then make changes accordingly.

Note that files placed into a "hot-folder" will remain there after the splitting. If you want to move them into
a different location after the processing, then modify the Powershell script accordingly.

Important: The following script is provided "as-is" without warranty of any kind. Use it at your own risk.
It is provided as an example only.

Right-click on the WatchFolder.ps1 in Windows Explorer and select "Run with Powershell" from a popup menu.

Powershell window will appear on screen, monitoring is active now.

Press Ctrl+C or simply close Powershell window to stop monitoring.

The script will output a dot every 5 seconds to indicate that it is live and working.

Log Files

The script will also create and maintain a log file (C:\Data\HotFolder\LogFile.txt) that records time when a new file
has been placed into a folder. Edit the script if you do not need this functionality.

The HotFolder.BAT file executed by folder-monitoring script will also create a separate log file that records every file
that has been processed. The log file shows the input filenames that have been successfully processed.
It will also record any errors encountered during the execution.
Note, that some PDF files cannot be processed due to the security settings or password-protection.