Set up as a Windows service
Step-by-step guide to running Automatic Email Processor as a background Windows service
This guide shows how to set up Automatic Email Processor as a Windows service that runs continuously in the background - without a user being signed in or the program window being open. This is the right operating mode for servers and for machines that should process email around the clock.
The service uses the program AEPProcessor.exe, which is installed next to the regular program. From then on you only start the main window occasionally, to maintain profiles or review 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, an elevated command prompt
- Result: Automatic Email Processor processes email continuously in the background, even with no user signed in
Video tutorial: Set up as a Windows service (with narration and optional subtitles)
Note: This guide covers the most common case - running as a classic Windows service. Other operating modes (NSSM, scheduled task, headless mode) and all command-line parameters are described in the program help, chapter 60.3 - Service mode and headless mode.
Step 1: Choose a dedicated account for the service
Create a dedicated Windows user account for the service (or use an existing user or domain account). The service will later run under this account.
Do not use the “Local System” account. The reason: sign-in data and permissions in Windows are always tied to a specific user. When the service runs as “Local System”, it cannot reach exactly these things:
- the sign-in to Microsoft 365 (the consent granted once is only valid for the user who granted it)
- saved account passwords (stored in the Windows vault per user)
- network printers (printer shares are set up per user)
In addition, the main window would otherwise permanently show the message “External processor not active”, even though the service is in fact working correctly - because the window and the service only recognize each other when both run under the same user.
Recommendation: Set up a dedicated account such as AEP-Service and give it a password that does not expire.
Step 2: Set up the program once under this account
Sign in to Windows once with the service account and start the regular program (AutomaticEmailProcessor.exe). Set everything up here completely:
- Add your email accounts and verify them with “Send/receive test message…” (see How to set up an IMAP account or set up a Microsoft 365 account).
- Enter your license.
- Create or import your profiles and verify them with a test run.
This step matters: account sign-ins 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: Install the service
Tip: As of version 4.5.0 you can leave this step to the program: simply enable the option from step 4 - if no service is set up yet, the program offers to set it up directly (a small dialog asks for the service name, service account and password; an administrator confirmation follows). The program also takes care of automatic start, recovery and the “Log on as a service” right. You only need the following commands if you prefer to create the service by hand.
Open an elevated command prompt (Run as administrator) and create the service with sc.exe. Adjust the path to AEPProcessor.exe to your installation location (the default is C:\Program Files\Automatic Email Processor 4) and enter your service account from step 1 at obj=:
sc.exe create "AEP4Service" binPath= "\"C:\Program Files\Automatic Email Processor 4\AEPProcessor.exe\" --service"
sc.exe config "AEP4Service" obj= ".\AEP-Service" password= "YourPassword"
binPath= points to AEPProcessor.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 each of binPath=, obj= and password= - that is how sc.exe requires it.
You do not need to set up automatic start and the first start of the service yourself here - the program does that for you in the next step. (If you prefer to do it by hand: sc.exe config "AEP4Service" start= auto and then sc.exe start "AEP4Service".)
Step 4: Enable the “External processor” option
So that the main window and the service do not get in each other’s way, enable the matching option - still signed in as the service account:
Open Options → Windows Service and, under Operating mode, tick “Use external processor (e.g. Windows service)”. Then close the program with OK. (Up to version 4.4.0, the option was located on the “Processing” page.)
The page also continuously shows the state of the service (set up, started, startup type, account) and bundles all management actions: set up, start, stop, correct, and remove the service.
“Use external processor” option in the program options on the Windows Service page
What this option does: The main window assumes that the service handles processing. It therefore no longer starts or stops a processing process of its own and serves only for configuration and for showing 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 here: Because you already created the service in step 3, the program detects on confirmation that it is not yet running and offers to start it directly and set it to automatic start. Confirm this prompt (an administrator confirmation) with Yes - the service then runs immediately and starts automatically with Windows from then on. If no service is set up yet, the program offers to set it up now (see the tip in step 3). If the program detects an incorrectly configured service - the program path points to the wrong executable - it offers the correction directly.
Step 5: Verify the service
Check that everything is running:
In the Windows Services console (services.msc), “AEP4Service” should have the status “Running” and the startup type “Automatic”.
If there are problems, the file ServiceDiagnostics.log helps. It is located in the application data folder of the service account:
%AppData%\Automatic Email Processor 4\ServiceDiagnostics.log
It contains the startup messages and - during operation - the entry IsWindowsService=True. If it says IsWindowsService=False, the service is not running as expected.
If the service unexpectedly does not run (for example because you declined the start prompt in step 4), start it by hand and set automatic start:
sc.exe config "AEP4Service" start= auto
sc.exe start "AEP4Service"
The regular processing and error logs appear, as usual, in the main window under Log.
Step 6: Set up an early warning on standstill (recommended)
During unattended continuous operation, no one notices right away if processing ever comes to a halt. So set up the notification on standstill: the program then automatically sends you an email as soon as no processing has happened for a defined period - so you learn about a problem without having to check yourself.
Open Options → Processing → Malfunction report, enable “Send message if no processing for x minutes” and enter a time span as well as one or more recipients.
Tip: For sending this warning, it is best to use a separate, simple account (under Options → Notifications) that is not among the monitored accounts. Because if the monitored account itself fails, a warning email sent through that same account may no longer go out.
Step 7: Ongoing operation
From now on, the service processes email continuously in the background - regardless of whether a user is signed in. You only start the main window when needed, to change profiles or view logs; the actual processing stays with the service.
If you later want to stop or remove the service:
sc.exe stop "AEP4Service"
sc.exe delete "AEP4Service"
Common problems
| Problem |
Solution |
| The main window reports “External processor not active” even though the service is running |
The service and the main window must run under the same user account. In services.msc, check under “Log On As” that the account from step 1 is shown there - not “Local System”. |
| The “External processor” box is ticked but nothing is processed at all (it only runs while the program window is open) |
When you tick the box, the program offers to start an existing but stopped service directly and set it to automatic start - if you declined that, do it now. Make sure the service is actually running: in services.msc the status should be “Running” and the startup type “Automatic”; ServiceDiagnostics.log must show IsWindowsService=True. If autostart is missing (startup type “Manual”), set it with sc.exe config "AEP4Service" start= auto and start it with sc.exe start "AEP4Service". Note: sc.exe create on its own only creates the service as “Manual”. |
| The service start hangs (“Windows is attempting to start the service…”) or fails with error 1053 |
The service points to the wrong program. Check the BINARY_PATH_NAME line with sc.exe qc "AEP4Service": it must point to AEPProcessor.exe - not to AutomaticEmailProcessor.exe (the main window); a missing --service parameter, by contrast, is harmless - the service also starts without it. As of version 4.5.0, the program detects this misconfiguration when the option is enabled or at program start and offers the correction directly. If an invisible “AutomaticEmailProcessor” process remains from an earlier start attempt, end it in Task Manager. |
| The service starts and stops again immediately |
Open ServiceDiagnostics.log in the AppData folder of the service account (see step 5) - it states the reason, often a missing license or an unreachable data folder. |
| The Microsoft 365 account keeps asking for sign-in in the service |
The sign-in must have been done once under the service account in the main window (step 2). Sign in to Windows with the service account and perform the sign-in there. |
| A network printer does not work in the service |
Printer shares apply per user. Connect the printer once under the service account, then the service recognizes it too. |
| “Local System” was selected |
This choice does not work reliably (see step 1). Switch to a real user account with sc.exe config "AEP4Service" obj= ".\AEP-Service" password= "…". |
| Processing runs twice |
Most likely the “Use external processor” option is not set (step 4), so the main window processes as well. Tick the box and restart the window. |
Try Automatic Email Processor free for 30 days ...
Download