# Run-script-after: Pass command line params to batch script

**URL:** <https://forum.duplicati.com/t/run-script-after-pass-command-line-params-to-batch-script/9829>\
**Category:** Features\
**Created:** [May 10, 2020, 1:09pm UTC](https://forum.duplicati.com/t/run-script-after-pass-command-line-params-to-batch-script/9829 "2020-05-10T13:09:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon66874424](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/a/958977/32.png) [@anon66874424](https://forum.duplicati.com/u/anon66874424)\
**Post date:** [May 10, 2020, 1:09pm UTC](https://forum.duplicati.com/t/run-script-after-pass-command-line-params-to-batch-script/9829/1 "2020-05-10T13:09:17Z")

</div>

Hi,

I’m trying to write a batch script under Windows for the option --run-script-after. So far so good it works. I’m reading the env vars fine and act on them. I now need to do something backup job specific. (Pass a special ID to my batch which should NOT be the same as the backup job name)  
When I set --run-script-after=c:\temp\test.cmd 123456 ABCDEFG DEFGZ , the batch script no longer gets executed by Duplicati and it tells on the UI it can’t find the batch “c:\temp\test.cmd 123456 ABCDEFG DEFGZ”. Can this be done with the current version or does it represent a feature request? I’d wisch I could store the batch params in every backup job.

Thank you.

Version: Duplicati 2.0.5.1 beta

---

<div class="post-metadata">

**Author:** ![drwtsn32](https://forum.duplicati.com/user_avatar/forum.duplicati.com/drwtsn32/32/2591_2.png) [@drwtsn32](https://forum.duplicati.com/u/drwtsn32)\
**Post date:** [May 10, 2020, 5:24pm UTC](https://forum.duplicati.com/t/run-script-after-pass-command-line-params-to-batch-script/9829/2 "2020-05-10T17:24:55Z")

</div>

You cannot pass parameters to the script like this - it’s not currently supported.

One workaround is to create a wrapper script that calls your main script with the parameter you want. You then call the wrapper script from your backup job. You’d need one wrapper script for each unique parameter of course, so it’s not ideal.

Maybe an option can be added in the future to support script command line parameters.

---

<div class="post-metadata">

**Author:** ![willygeerts](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/w/ba8739/32.png) [@willygeerts](https://forum.duplicati.com/u/willygeerts)\
**Post date:** [February 7, 2024, 4:47pm UTC](https://forum.duplicati.com/t/run-script-after-pass-command-line-params-to-batch-script/9829/4 "2024-02-07T16:47:37Z")

</div>

I to would love to have parameters possible on run-script.  
You can pass a password to your script and have it protected by Duplicati encryption.  
If you use password in plain in your scripts, they are vulnerable.

---

<div class="post-metadata">

**Author:** ![ts678](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/t/8491ac/32.png) [@ts678](https://forum.duplicati.com/u/ts678)\
**Post date:** [February 7, 2024, 5:38pm UTC](https://forum.duplicati.com/t/run-script-after-pass-command-line-params-to-batch-script/9829/5 "2024-02-07T17:38:03Z")

</div>

Since this just got treated as a feature request, I changed its category to make it a bit easier to see.  
GitHub is a better tracker (but less visible for most users), so I’ll point to that enhancement request:

> <https://github.com/duplicati/duplicati/issues/2926>
>
> \- \[x\] I have searched open and closed issues for duplicates.
> 
> \----------------…------------------------
> 
> \## Environment info
> 
> 
> \- \*\*Duplicati version\*\*: 2.0.2.1-1
> \- \*\*Operating system\*\*: Ubuntu 16.04.3 LTS
> \- \*\*Backend\*\*: local filesystem
> 
> \## Description
> 
> I need to call a script with arguments but when I call the task I get:
> 
> \`ApplicationName='/home/foo/bar.sh jhon doe', CommandLine='', CurrentDirectory='', Native error= Cannot find the specified file\`
> 
> \## Steps to reproduce
> 
> 1. Install duplicati
> 2. Configure a backup with the option \`run-script-before-required\`
> 3. Give to your scripts arguments
> 
> 
> 
> \- \*\*Actual result\*\*:
> The backup fails with this log \`ApplicationName='/home/foo/bar.sh jhon doe', CommandLine='', CurrentDirectory='', Native error= Cannot find the specified file\`
> \- \*\*Expected result\*\*:
> The backup calls the script \`'/home/foo/bar.sh\` sending \`jhon\` and \`doe' as arguments.
> 
> Thanks

Similar existing forum Features request:

> [@Arguments when running a script (via run-script-before-required)](https://forum.duplicati.com/t/arguments-when-running-a-script-via-run-script-before-required/1582):
>
> I need to call a script with arguments but when I call the task I get: ApplicationName='/home/foo/bar.sh jhon doe', CommandLine='', CurrentDirectory='', Native error= Cannot find the specified file ¿How should I call the options for using arguments? Thanks a lot
