Mail Attachment Downloader 4.0 runs your PowerShell script, batch file or program when the right email arrives, for each attachment it saved or once per email, with the sender, the subject, the saved file's path and any value read from the email passed as arguments. The script does what only your systems know how to do; the program handles the mailbox, the rules and the retries. It runs on your Windows server as a service.
The Run a script step starts a program with the arguments you write, filled from the rule's fields.
📖 See the featurepowershell.exe (Windows PowerShell) or pwsh.exe (PowerShell 7), the full path, without quotes.-NoProfile -ExecutionPolicy Bypass -File "C:\Scripts\Import-Invoice.ps1" -Path "{SAVE_FILE}" -Supplier "{SUPPLIER}"{EMAIL_FROM}, {SUBJECT}, {DATE[yyyy-MM-dd]}, the saved file ({SAVE_FILE}) and its folder ({SAVE_PATH}), or a value read from the PDF.The Run a command line step does the same through cmd, for a .bat file or a one-line command.

The program and its arguments, filled from the rule's fields (here Run a command line).
A script that fails shouldn't fail quietly.
A script that exits with a code other than 0 fails the step: the rule's If something fails steps run, such as moving the email to Needs attention.
A script that hangs is stopped after the timeout you set (5 minutes by default) and the step fails.
Each run is in Activity and History, and the script's output in the log, so you can see what it was given and what it said.
Anything a script can do on your network, started by the email it needs.
Hand the saved order or invoice file to an import tool, an ERP command line or a stored procedure the email's values select.
Make the project folder, set its permissions in Active Directory or SharePoint, and move the attachments in, from a request email.
Start a report, a print run, a sync or a backup when the email that says "ready" arrives, from a monitoring system or a partner.
Rules pick the emails, save the files and run the script, as mail arrives.
Any mailbox, any provider
Sender, subject, attachment name
And values read from them
With them as arguments
An AI agent could be given a shell and told to react to emails, but it reads every email through its service, spends tokens each time, and could run something different from what you meant. A rule runs exactly the script you chose, with exactly the arguments you wrote, and records each run. AI, if you want it, only reads values out of the email for the arguments, such as an order number. How rules and AI work together
A scheduled script that polls the mailbox works until the sign-in, the mailbox or its author changes.
| Capability | Mail Attachment Downloader PRO | A polling script you maintain | Outlook rules (run a script) | Cloud automation (Zapier-style) |
|---|---|---|---|---|
| Gmail, Microsoft 365, Exchange and any IMAP mailbox, with sign-in handled | ✓ | You write it | Outlook only | Varies by connector |
| Runs with no one signed in, as a Windows service | ✓ | ✓ | ✗ | Runs in their cloud |
| Attachments saved first, their paths passed in | ✓ | You write it | You write it | ✗ |
| Values read out of the email and its PDFs as arguments | ✓ | You write it | ✗ | With some work |
| Each email once, and a record of every run | ✓ | You write it | Varies | ✓ |
| Any number of emails and runs, with no per-task fees | ✓ | ✓ | ✓ | Usually billed per task or run |
Set Program to powershell.exe (Windows PowerShell 5.1) or pwsh.exe (PowerShell 7), and put -File with your script's path and its parameters in Arguments, such as -NoProfile -ExecutionPolicy Bypass -File "C:\Scripts\Import-Invoice.ps1" -Path "{SAVE_FILE}".
As command-line arguments, filled from the rule's fields: the sender, subject, date, the saved file's path and folder, and any value read from the email or its files. Quote each one, as in "{SUBJECT}".
Not as fields: the output goes to the log. A script that needs to hand something back can write a file the rule or a watch picks up, or call the Web hook step's API itself.
The account that runs the program: you, in the app, or the Windows service's account with PRO Rules Server. Give that account the rights the script needs, and no more.
A non-zero exit code, or running past the timeout, fails the step. The rule's If something fails steps then run, and History records it.
PRO Rules Server, which has Run a script and Run a command line, and the Windows service that runs them around the clock with no one signed in.
Each edition includes everything in the ones before it: Free, PRO Backup, PRO Parser, PRO Rules Client, PRO Rules Server.
PowerShell, Python or any program, with the email's values as arguments. PRO Rules Server.
A .bat file or a command through cmd. PRO Rules Server.
Call an API instead of, or as well as, a script. PRO Rules Server.
Values from the email and its PDFs, for the arguments. PRO Rules Client and up.
Only the emails you want, by sender, subject, account or attachment. PRO Rules Client and up.
The Windows service runs it with no one signed in. PRO Rules Server.
Start the 30-day trial, add a Run a script step, and run it once on a sample email.