Batch running InVest modules from Windows cmd.exe

Hello there,

I am trying to set up a process for batch running InVest modules from Windows cmd.exe. I know it is possible to do it using Python, but I only have to an old windows machine and I cannot find/match the python dependencies as much as I 've tried.

In essense, I want to able to batch run InVest modules and only change the land use file each time, keeping the same args, but in cmd.exe. In fact, I want to follow the example from the user guide (“Example: Invoke NDR Model on a directory of Land Cover Maps”) but in cmd.exe.

Is this possible? Does anyone have an example?

Any help would be appreciated.

Kind regards,


1 Like

Hi Dimitrios, great question. It sounds like you’re looking for the command-line interface to invest. See the documentation here: The InVEST CLI — InVEST 3.9.1.post81+gf84a06f5.d20211029 documentation

Basically you will need to setup a .json file datastack for each of your scenarios. That’s where you can specify the different landuse layer for each one. And then you can see examples in the documentation of how to call a model. For example:
invest -vv run --headless ndr -d my_datastack.json -w my_workspace


Hi Dave,
Thank you for the quick reply!
I will try and let you know if I succeed… Perhaps I will need more help, but I am positive!

1 Like

Hello again,

With your help, a bit of internet searching for creating windows batch files, and some laborious coding for string manipulation in R, I can now double click on a .bat file and run 362 different InVest carbon models, all with different land use future maps!

If anyone wants more info, please do ask.

Again, Dave, thank you for the invaluable input.

Kind regards,



This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.