Select your language

There are several requirements for this:

  1. Printing once per day
  2. Printing every X minutes
  3. printing X mins after the last job arrived
  4. Printing any other time interval, longer then a day.
  5. etc.

And as well, there are several solutions for this issue:

  1. Using the Windows Queue time based printing possibilities
  2. Using the MS DOS command AT (Windows 7)
  3. Using the Windows Scheduler SCHTASKS.EXE (Windows 8 or newer)

Printing once per day (Windows platform)

This can be handled with MS Windows standard Queue settings:

Open the properties of the queue, switch to the enhanced tab and enter the start and end time for printing. ELP can send the jobs to that queue using the outport or the CALL command.

Theory of printing any time

All following time based samples do have this in in common:

  1. The print files need to be stored somewhere in an archive directory and
  2. They are most likely copied with a MS DOS batch file or Linux Shell-Script to the destination queue. Here is an easy batch file content, which can be generated with any ASCII editor like Notepad++;:

    Content of file MyCopy.bat Command description
    c: change to volume where the archive files are located
    cd c:\ProgramData\Welp\archive change prompt to the directory containing the archived files
    copy /b invoice*.* \\\QueueShareName

    send all files of the folder in one(!) file to the windows queue on the same PC

    • If you need single files (Each archived file as one job) then use this command:
      FOR %%i in (invoice*.*) do cmd /c copy /b "%%i" \\\Sharename
    • If you need all files, simply remove the word invoice, also in the next command
    • You may use any other command line utility for sending or moving or copying the files
      FOR %%i in (invoice*.*) do lpr -S -P SharedPort "%%i"
    del /Q invoice*.* Delete all copied files with the file name starting invoice (the parameter /Q avoids a confirmation prompt)
  3. Now use the scheduler of your choice and call this batch file at the needed time. If needed nail down rules to the receiving queue or call just another iniFile for all jobs coming into that queue. Example 2

Instead of using a batch file a DOS echo command can send a test to an ELP activated queue, which then prints all files. See sample Example: MyPrintArchive - Collect4Printing

The extended example: Our application sends X jobs, we want to collect them all and print them in one job, so that nobody else can interfere with his job.

The theory of the implementation:

  • Let us assume, that the rule is print queue related, so the queue will collect and archive all jobs.
  • Every time a job was processed, the DOS Command AT is called twice,
    - first to reset the process 1 (which is available after the first job arrived) and then
    - to set the new timer.
  • Finally at time xx:xx (Hour:Min) the AT will send all files to the same queue, but including an initialization term, which helps ELP to understand, if it is a collected stream or a stream coming form the application.

This configuration fixes the problem, that the application sends 1000s of small jobs to the printer, which unfortunately needs a big initialization time between each job. So the over all printing speed went down.

With the following configuration the printer starts printing all jobs together at full speed, latest 3 minutes after the last job arrived.

Here the convert.ini:


; Any of your stuff

VARIABLE=MyConversion:Not Available

; store the actual minutes to the variable: MyStartMin


; store the actual Hour to the variable: MyStartStd


; Reset the temp variable to 0 seconds



[This data stream was the collected resend one]

; When this trigger statement was found in the stream (right at the beginning)

Search_Binary=%-12345X@PJL SET COMMENT="2nd run"

; then pass the job through and exit the rule interpretation



; **********
; Those rules are processed after the job was completely read into the process.
; All the primary rules below gets always true, because of TRIGGER_BINARY=!

[Increase now the Minutes by 2 minutes]

; As the printing should start max 3 mins after the last job arrived


; routine only valid up to a wait time of 59 minutes!


[Check if minutes go over the hour]


; then reduce it by 59 seconds


; and add one hour


[Check if hour goes over 23]


; set to after midnight


[Store the job and set the timer]

; As the printing should start max 3 mins after the last job arrived


; Store the file to the archive


; do not print anything


; Store the file to the archive


; and call the batch file SetTime.bat with those arguments:
; 1. Time when timer should start #MyStartStd#:#MyStartMin#
; 2. Which software the timer shall call #ELP_FORMS_PATH#DoAt.bat
; 3. For reprinting the path to the Workpath folder #ELP_FORMS_PATH#
; 4. To which \\server\Queue the jobs shall be sent as one print job #PRINTERSHARENAME#

call=#ELP_FORMS_PATH#SetTime.bat "#MyStartStd#:#MyStartMin#" "#ELP_FORMS_PATH#DoAt.bat" "#ELP_FORMS_PATH#" \\\#PRINTERSHARENAME#;OFF

So the batch file SetTime.bat in the Workpath folder (default c:\ProgramData\Welp) is in charge of setting the new timer time. Here the content of the file SetTime.bat:

echo "Time passed in" %1
echo "batchfile to be called after time is reached" %2
echo "Where are my data" %3
echo "Where to send the collected streams" %4
REM Delete the actual timer setting of timer 1
REM Set the new timer time program operand1 operand2
AT %1 %2 %3 %4

On Windows 10 or newer the AT command does not work anymore. So you need to use the task scheduler SCHTASKS.EXE instead. The batch file SetTime.bat needs to look like this:

SCHTASKS /CREATE /TN "ELPTASK" /TR "cmd /c '%2 %3 %4" /SC ONCE /ST %1

In other words, this DOS Command file does

  1. delete a possible existing timer from last job
  2. set the timer, so that
    - after the time is reached (#MyStartStd#:#MyStartMin# e.g. 12:45)
    - the software #ELP_FORMS_PATH#DoAt.bat is called
    - with the 2 additional parameters of where to copy the collected data streams form #ELP_FORMS_PATH# (Workpath folder c:\ProgramData\Welp, the additional subfolder is added in batch file)
    - and where the files are sent to, actually the same queue: #PRINTERSHARENAME# (e.g. \\\ELP_Out)

And the second batch file #ELP_FORMS_PATH#DoAt.bat which is called by the DOS AT command or SCHTASKS: DoAt.bat

echo "Start Path for archived files " %1
echo "Port to be sent" %2
rem init.pcl contains the differentiator for standard print files and final prints
copy /b %1init.pcl+%1archive\*.* %2
rem delete the stored files.
del /Q %1archive\*.*

Finally the content of the init.pcl file also stored at #ELP_FORMS_PATH#:

\x1B%-12345X @PJL SET COMMENT="2nd run"

The copy comand of DoAt.bat copies that file in front of the data stream. The file holds valid PJL commands, but does actually do nothing. The comment text is used to by the ELP rules, to identify the collected print job, that it is passed through and not again stored. Please generate that job also with Notepad++. The Escape signs (\x1B) can be entered by holding down the ALT key and entering on the num pad 027.

Testing the configuration (with the AT command. For Windows 10 and newer please use the SCHTASKS commands like described above):

    1. After the first job is sent, check the c:\ProgramData\Welp\archive folder if a file was stored
    2. Open a DOS Box and start the command AT (the content should be pretty similar)

      Status. Day Time Command
      1 Today 09:47 c:\ProgramData\Welp\DoAt.bat c:\ProgramData\Welp\ \\\ELP_OUT
    3. If you like you can delete that timer. Any way, sending a second job does resset the timer

      AT 1 /delete
    4. The files should be printed after the time was reached. If not here is how to debug the solution:

      4.1 check first if the AT command still has a Job with the ID 1. If yes, the timer did not start yet.

      4.2 If gone, then try to initalize the timer event by hand, it is the eaxct same command as the timer showed:

      #ELP_FORMS_PATH#DoAt.bat c:\ProgramData\Welp\ \\\ELP_OUT

      Any error should be now displayed in the DOS box.
    5. Sometimes MS Windows can't handle the localhost IP Then please change in the convert.ini the last argument of the call key the 127.0.01 with the real server name or with the variable #HOSTNAME#.
    6. Of course the queue needs to be shared!

Addon: Maybe in addition you whish to print always when X jobs have arrived. Those modifications need to be done:


; Add to the AS400in rule section this line:


Generate a new rule

[On every 50th job]


; Primary trigger, which comes for all jobs true


And finally add to the DoAt.bat batch file the command for erasing the job_counter file:
del /Q %1job_counter.var


Related articles: Collection small single jobs to eliminate the printer job setup time


We use cookies

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.