Command Line Parameters

I use to run TouchDesigner’s installations automatically when Windows starts with a batch file on the autostart folder.
It would be great to start tTD or the patch with a command line parameter that could be read inside the patch.
Thank you

Seems like sys.argv does not work, and in this area argparse does not too (which is such a nice tool btw.)

I think the best way for that is to use env variables instead.
In your bat, call

set foo=bar

in TD you can now use either var(“foo”) or os.environ.get(“foo”) to get the value.
Note that this ENV-Variable will only bet set for everything that gets started from the BAT. Other processes will not know of that specific value.
You can set a ENV-Variable permanently by calling
setx foo bar
This will not be stored for ever.
Combine this with a config-file-compoent like this one that can read differrent values depending on an env. variable set:

The env variables solution is absolutely perfect!
Thank you so much!