Set up as a Windows service
Step-by-step guide to running Automatic X-Invoice Processor as a Windows service in the background
This guide shows how to set up Automatic X-Invoice Processor as a Windows service that runs permanently in the background - without a user having to be logged in or the program window having to be open. This is the right operating mode for servers and for machines that are supposed to process e-invoices around the clock.
The service uses the program AXPProcessor.exe, which is installed alongside the normal program. Afterwards, you only start the main window occasionally to maintain profiles or check the logs.
At a Glance
- Difficulty: Advanced (administrator rights required)
- Time required: approx. 15 minutes
- Prerequisites: Installed program, a Windows user account for the service, a command prompt as administrator
- Result: Automatic X-Invoice Processor processes e-invoices permanently in the background, even without a logged-in user
Video tutorial: Set up as a Windows service (with narration and optional subtitles)
Note: Is it enough for processing to run while a user is logged in? Then the simpler, unobtrusive continuous operation in the notification area is all you need - see How-to: Autostart and background operation. Further details on service mode (command-line parameters, diagnostics) can be found in the program help, chapter 60.1.4.
Step 1: Choose a dedicated user account for the service
Create a dedicated Windows user account for the service (or use an existing user or domain account). The service will run under this account later.
Do not use the “Local System” account. The reason: settings and permissions in Windows are always tied to a specific user. If the service runs under “Local System”, it cannot access exactly these things:
- the profiles, program options, and the license (they are stored in the user’s application data folder)
- saved passwords of the email sending accounts (especially when stored in the Windows Credential Manager) and the Microsoft 365 (Exchange Online) sign-in
- network printers (printer connections are set up per user)
In addition, the main window and the service can only see each other (status display, logs) if both run under the same user.
Recommendation: set up a dedicated account such as AXP-Service and assign a password that does not expire.
Log in to Windows once with the service account and start the normal program (AutomaticXInvoiceProcessor.exe). Set up everything here:
- Enter the license.
- Create or import profiles and verify them with a test run (see How-to: Getting started).
- If profiles send emails: verify the sending account with Send test message…; if they print: connect the printer once under this account.
This step is important: profiles, options, and the license are stored for exactly this user account. The service can later only use what was set up here under its account.
Step 3: Create the service
Open a command prompt as administrator and create the service with sc.exe. Adjust the path to AXPProcessor.exe to your installation location (the default is C:\Program Files\Automatic X-Invoice Processor 2) and enter your service account from step 1 at obj=:
sc.exe create "AXP2Service" binPath= "\"C:\Program Files\Automatic X-Invoice Processor 2\AXPProcessor.exe\" --service"
sc.exe config "AXP2Service" obj= ".\AXP-Service" password= "YourPassword"
binPath= points to AXPProcessor.exe with the --service parameter.
obj= is the user account the service runs under - exactly the account under which you set everything up in step 2. For a local account write .\AccountName, for a domain account Domain\AccountName.
Important: there is a space after binPath=, obj=, and password= - sc.exe requires it that way.
You do not need to configure the automatic start, the crash recovery, or the first start of the service yourself - the program takes care of that for you in the next step.
Step 4: Enable the “External processor” option
So that the main window and the service do not interfere with each other, enable the corresponding option - still under the service account:
Open Options → Processing and, at the very bottom under External processor, check “Background processor is managed externally (e.g. as a Windows service)”. Then close the dialog with OK.
Option “Background processor is managed externally” in the program options under Processing
What this option does: the main window assumes that the service handles the processing. It therefore no longer starts and stops its own processing process; it only serves for configuration and for displaying the logs. Without this option, the window would start its own processor on every launch and get in the service’s way.
The service is started in the process: since you already created the service in step 3, the program detects on confirmation that it is not yet running and offers to start it right away and set it to start automatically - this also configures the automatic recovery after a service crash (Windows then restarts the service itself if needed). Confirm the prompt with Start service and the subsequent administrator prompt - the service then runs immediately and will start automatically with Windows from now on. If no service is set up yet, a notice points this out.
Step 5: Verify the service
Check that everything is running:
In the Windows service management console (services.msc), “AXP2Service” should have the status “Running” and the startup type “Automatic”.
In Task Manager you will see two AXPProcessor.exe processes - this is by design: one is the supervisor (the actual service), the other is the worker process that performs the processing. If a file ever gets permanently stuck, the supervisor only replaces the worker process, and processing continues without intervention.
If there are problems, the file ServiceDiagnostics.log helps. It is located in the application data folder of the service account:
%AppData%\Automatic X-Invoice Processor 2\ServiceDiagnostics.log
It contains the startup messages; in service operation it shows IsWindowsService=True. If it only shows IsWindowsService=False, the service is not running as expected.
If, contrary to expectations, the service is not running (for example because you declined the start prompt in step 4), start it manually and set the automatic start:
sc.exe config "AXP2Service" start= auto
sc.exe start "AXP2Service"
The regular processing and error logs appear in the main window under Log as usual.
Step 6: Set up an early warning for stalls (recommended)
In unattended continuous operation, nobody notices right away if processing ever comes to a halt. Therefore, set up the malfunction notification: the program then automatically sends you an email as soon as no processing has taken place for a defined period - you learn about a problem without having to check yourself. In service operation, the supervisor process performs this monitoring.
Open Options → Processing → Malfunction notification, enable “Send message if no processing for x minutes”, and enter a time span as well as one or more recipients. Sending uses the account from Options → E-mail sending.
Independently of the email, every detected malfunction always appears in the error log and the Windows Event Viewer.
Step 7: Ongoing operation
From now on, the service processes e-invoices permanently in the background - regardless of whether a user is logged in. You only start the main window when needed to change profiles or view logs; the actual processing stays with the service.
If you want to stop or remove the service later:
sc.exe stop "AXP2Service"
sc.exe delete "AXP2Service"
Common problems
| Problem |
Solution |
| Main window shows no processing status although the service is running |
Service and main window must run under the same user account. Check in services.msc under “Log on as” that the account from step 1 is set there - not “Local System”. |
| The “External processor” checkbox is set, but nothing is processed at all |
When you set the checkbox, the program offers to start an existing but stopped service right away and set it to start automatically - if you declined, do it now. Check that the service is really running: in services.msc, status “Running” and startup type “Automatic”. If autostart is missing (startup type “Manual”), fix it with sc.exe config "AXP2Service" start= auto and start it with sc.exe start "AXP2Service". Note: sc.exe create alone creates the service with startup type “Manual”. |
| Service starts and stops again immediately |
Open ServiceDiagnostics.log in the AppData folder of the service account (see step 5) - the reason is stated there. |
| Two AXPProcessor processes in Task Manager |
By design: supervisor + worker process (see step 5). |
| Network printer does not work in the service |
Printer connections apply per user. Connect the printer once under the service account, then the service recognizes it as well. |
| “Local System” was chosen |
This choice does not work (see step 1). Switch to a real user account with sc.exe config "AXP2Service" obj= ".\AXP-Service" password= "...". |
| Processing runs twice |
Most likely the option “Background processor is managed externally” is not set (step 4), so the main window processes in addition. Set the checkbox and restart the window. |
Start your no-obligation, 30-day free trial of Automatic X-Invoice Processor now ...
Download