# How should I pass arguments when running Slicer in batch mode?

**URL:** <https://discourse.slicer.org/t/how-should-i-pass-arguments-when-running-slicer-in-batch-mode/8217>\
**Category:** Support\
**Created:** [August 28, 2019, 8:44pm UTC](https://discourse.slicer.org/t/how-should-i-pass-arguments-when-running-slicer-in-batch-mode/8217 "2019-08-28T20:44:56Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Sam\_Horvath](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sam_horvath/32/3092_2.png) [@Sam\_Horvath](https://discourse.slicer.org/u/Sam_Horvath)\
**Post date:** [August 29, 2019, 3:24pm UTC](https://discourse.slicer.org/t/how-should-i-pass-arguments-when-running-slicer-in-batch-mode/8217/2 "2019-08-29T15:24:53Z")

</div>

Everything after --python-script until the next recognizable flag is passed into the python interpreter:

Run:  
`./Slicer.exe --no-main-window --python-script test.py param1 param2 param3`

Where test.py is:  
`print(sys.argv)`

You will get this output on the console:  
`['test.py', 'param1', 'param2', 'param3']`

---

_[View the full topic](https://discourse.slicer.org/t/how-should-i-pass-arguments-when-running-slicer-in-batch-mode/8217)._
