Start Rhino + GH definition with commandline options? [Solved]

OK, so I would like to start Rhino with a bat file and have Rhino open a specific Grasshopper definition using commandline options specified in the bat file (or powershell).

What I have so far is a command string specified in the Rhino settings section General \ Command Lists, like so:

bild

But, the path may change for different calls (different projects) so I’d like to be able to have all options defined in a cmdline string in different bat/ps1 -files, something like this

..\..\rhino.exe _Grasshopper _Document _Open "D:\GHProjects\Main.ghx" _Enter

The Main.gh will then “take over” the show and open a rhino-file and also invoke a list of other GH files and run them. The intent is to be able to run a workflow unattended starting from a cmdline script.

Better ideas?



EDIT: The following script does what I want, whether it was pure luck or not:

file: “start_rhino.ps1”

[System.Diagnostics.Process]::Start("Rhino.exe", "/nosplash /Grasshopper run\\0000_Main.ghx").WaitForExit()
Write-Host "Rhino.exe has terminated."

// Rolf