# .bat file to automatically load state?

**URL:** https://discourse.paraview.org/t/bat-file-to-automatically-load-state/4373
**Category:** ParaView Support
**Created:** [May 20, 2020, 1:48pm UTC](https://discourse.paraview.org/t/bat-file-to-automatically-load-state/4373 "2020-05-20T13:48:26Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![AhmedSalih3d](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ahmedsalih3d/32/14109_2.png) [@AhmedSalih3d](https://discourse.paraview.org/u/AhmedSalih3d)
#### Post date: [May 20, 2020, 1:48pm UTC](https://discourse.paraview.org/t/bat-file-to-automatically-load-state/4373/1 "2020-05-20T13:48:26Z")

</div>

Hello!

Imagine I have a folder structure as:

Base -\> Particles -\> Content.vtk

Is it possible to define a state using Paraview, which uses “Content.vtk”, and then from command line do something like (pseudo syntax);

loadstate: mystate.pvsm folder: Base

So I can work much faster than having to manually click all the time.

Kind regards

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 21, 2020, 2:57am UTC](https://discourse.paraview.org/t/bat-file-to-automatically-load-state/4373/3 "2020-05-21T02:57:51Z")

</div>

`paraview --state=yourState.pvsm` will let you load directly without letting you choose the folder. Is that what you want ?

---

<div class="post-metadata">

### Author: ![AhmedSalih3d](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ahmedsalih3d/32/14109_2.png) [@AhmedSalih3d](https://discourse.paraview.org/u/AhmedSalih3d)
#### Post date: [May 21, 2020, 4:31pm UTC](https://discourse.paraview.org/t/bat-file-to-automatically-load-state/4373/4 "2020-05-21T16:31:19Z")

</div>

Almost! I would like it so that I can run this state on files in different folders. I might have the same simulation with different resolution for example three folders;

Sim1 (dx = 0.5)  
Sim2 (dx = 0.25)  
Sim3 (dx = 0.05)

And then inside each folder I will have a vtk with the same name, for example “Content.vtk”, and then I want by using a state in a fast manner to view contents in Paraview.

Kind regards

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 22, 2020, 2:52am UTC](https://discourse.paraview.org/t/bat-file-to-automatically-load-state/4373/5 "2020-05-22T02:52:57Z")

</div>

I’m afraid this is not supported yet. I think it would made sense to add a `--state-directory` option to cover your use case. Feel free to open an issue on our gitlab :  
[https://gitlab.kitware.com/paraview/paraview/-/issues](https://gitlab.kitware.com/paraview/paraview/-/issues)

In the meantime, the only work around I can think of is to edit your file with a script in order to change the directory directly in it.

---

<div class="post-metadata">

### Author: ![AhmedSalih3d](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ahmedsalih3d/32/14109_2.png) [@AhmedSalih3d](https://discourse.paraview.org/u/AhmedSalih3d)
#### Post date: [May 22, 2020, 3:55pm UTC](https://discourse.paraview.org/t/bat-file-to-automatically-load-state/4373/6 "2020-05-22T15:55:36Z")

</div>

I am not sure if I have done it correctly, but I opened a new issue here:

[https://gitlab.kitware.com/paraview/paraview/-/issues/19948](https://gitlab.kitware.com/paraview/paraview/-/issues/19948)

Kind regards
