# Launch slicer from the command line with an argument to load a file

**URL:** <https://discourse.slicer.org/t/launch-slicer-from-the-command-line-with-an-argument-to-load-a-file/796>\
**Category:** Support\
**Created:** [August 1, 2017, 1:36am UTC](https://discourse.slicer.org/t/launch-slicer-from-the-command-line-with-an-argument-to-load-a-file/796 "2017-08-01T01:36:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tkuraku](https://avatars.discourse-cdn.com/v4/letter/t/e47774/32.png) [@tkuraku](https://discourse.slicer.org/u/tkuraku)\
**Post date:** [August 1, 2017, 1:36am UTC](https://discourse.slicer.org/t/launch-slicer-from-the-command-line-with-an-argument-to-load-a-file/796/1 "2017-08-01T01:36:50Z")

</div>

I would like to be able to launch slicer via command line (from python) and have it automatically load and display a specified nrrd file. Is this possible? I searched some of the documentation but I couldn’t quite find what I wanted.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [August 1, 2017, 1:45am UTC](https://discourse.slicer.org/t/launch-slicer-from-the-command-line-with-an-argument-to-load-a-file/796/2 "2017-08-01T01:45:59Z")

</div>

See these examples:

[https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Launching\_Slicer](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Launching_Slicer)

---

<div class="post-metadata">

**Author:** ![moselhy](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/moselhy/32/501_2.png) [@moselhy](https://discourse.slicer.org/u/moselhy)\
**Post date:** [August 1, 2017, 3:28pm UTC](https://discourse.slicer.org/t/launch-slicer-from-the-command-line-with-an-argument-to-load-a-file/796/3 "2017-08-01T15:28:25Z")

</div>

Say you have Slicer.exe in "C:\Program Files\Slicer 4.7.0-2017-07-29\Slicer.exe"  
and you have a Nrrd file in “C:\CTACardio.nrrd”

You would run this in Command Prompt:

“C:\Program Files\Slicer 4.7.0-2017-07-29\Slicer.exe” “C:\CTACardio.nrrd”

---

<div class="post-metadata">

**Author:** ![tkuraku](https://avatars.discourse-cdn.com/v4/letter/t/e47774/32.png) [@tkuraku](https://discourse.slicer.org/u/tkuraku)\
**Post date:** [August 1, 2017, 4:26pm UTC](https://discourse.slicer.org/t/launch-slicer-from-the-command-line-with-an-argument-to-load-a-file/796/4 "2017-08-01T16:26:22Z")

</div>

Thank you both. This solves my problem!
