Unable to start new process in other directory

@piac Maybe you can help me with a very similar problem:

I want to use the command line to call V-Ray Cloud with some options (but for this example the “help” command is okay).

But the problem is that it seems to be okay if there are spaces in the path you pass to it, but I can’t figure out how I can have a space in the path of the first part (the path to the exe file).

from subprocess import call

command = r" --help"
path = r"C:\Users\Corsair One\AppData\Roaming\Chaos Group\Cloud\Client\ccloud.exe"

if x:
    call(["cmd", "/K", path + command + ""]) 

But I keep getting:

Thanks for any hints on how to escape the file path properly. I remember trying this a few years ago as well and in the end there was no real way to do it like that and I had to resort to some other trickery that I can’t remember. But surely there must be a way to do this seemingly simple thing from within GH: launch an exe with some command line properties.

These are the things I would like to trigger from Grasshopper: Managing Render Jobs Through a Command Line Interface in Chaos Cloud - Chaos Cloud - Chaos Help

I moved the post to a new thread, originally this was posted here:
https://discourse.mcneel.com/t/grasshopper-python-how-to-start-a-cmd-window-and-send-commands-to-it-with-options/62832/3

There’s some discussion regarding this here:

See if some of the answers gets you farther! Otherwise, some .Net function might work. Please ask more if you need more help.

1 Like