# Run exe on Successful backup

**URL:** <https://forum.duplicati.com/t/run-exe-on-successful-backup/447>\
**Category:** Support\
**Created:** [September 5, 2017, 6:59pm UTC](https://forum.duplicati.com/t/run-exe-on-successful-backup/447 "2017-09-05T18:59:27Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![kees-z](https://forum.duplicati.com/user_avatar/forum.duplicati.com/kees-z/32/29_2.png) [@kees-z](https://forum.duplicati.com/u/kees-z)\
**Post date:** [September 5, 2017, 8:38pm UTC](https://forum.duplicati.com/t/run-exe-on-successful-backup/447/2 "2017-09-05T20:38:37Z")

</div>

You can use the options `--run-script-after` to execute a script after a backup is completed (successful or unsuccessful).  
I think a script like this could do the trick:

```
@echo off
set "ProgramSuccess=C:\Prog\Prog1.exe"
set "ProgramFail=C:\Prog\Prog2.exe"
set "Tempfile=%Temp%\_Duplicati_Result.tmp"
if exist "%Tempfile%" del "%Tempfile%"
type "%DUPLICATI__RESULTFILE%" >> "%Tempfile%"
for /f "tokens=1,2 usebackq delims=: " %%a in ("%Tempfile%") do (
  if /i "%%a"=="ParsedResult" (
    if /i "%%b"=="Success" (
      start "%ProgramSuccess%"
    ) else (
      start "%ProgramFail%"
    )
  )
)

```

WARNING: I didn’t test this script, use at your own risk!  
You can find some example scripts here:

> **[duplicati/duplicati](https://github.com/duplicati/duplicati/tree/master/Duplicati/Library/Modules/Builtin)**
>
> Store securely encrypted backups in the cloud! Contribute to duplicati/duplicati development by creating an account on GitHub.

---

_[View the full topic](https://forum.duplicati.com/t/run-exe-on-successful-backup/447)._
