How can I start Rhino with a specific working directory via shortcut or batch file ?
Hi @juancarreras,
right click on your desktop, choose “new” then “link” and browse to your Rhino.exe to create a regular link. Once ready, right click on your link, choose “properties” and under destination change it to look like like this:
"C:\Program Files\Rhinoceros 5.0 (64-bit)\System\Rhino.exe" /runscript="_-SetWorkingDirectory ""D:\Temp"""
Note the double quotes around the path D:\Temp, this is required if your path has spaces in it, otherwise it is not required.
c.
Hi @clement,
It doesn’t seem to work … I get an error.
Here is my shortcut which seems to work:
note the quotes, i have two quotes in front of the path and two after it, then another one to close the quote which starts after runscript. If you do not have spaces in that path, just remove one quote before and one after the path.
c.
I understand the quotes sequence. I had already a shortcut and I edited it and I was having the error. Now I created a fresh one and it worked. Go figure …
Thanks !
Is the above still valid?
when using
"C:\Program Files\Rhino 7\System\Rhino.exe" /runscript="_-SetWorkingDirectory "C:\temp""
I notice that the _SetWorkingDirectory command is passed on to Rhino, but the path isn’t (and a popup window for selecting the folder is opened). I tried single quotes for the path, double quotes, with and without a trailing backslash.
tried the above both with Rhino 6 and 7.
Hi @wni, unfortunately not. It seems that the command _-SetWorkingDirectory
has to be replaced with _-SetWorkingFolder
to make it work. For Rhino 7 this is the sequence which works for me:
"C:\Program Files\Rhino 7\System\Rhino.exe" /runscript=" _-SetWorkingFolder ""D:\Temp"""
@pascal, is it desired that the former command now just calls the new one and ignores the dash to suppress the dialog ?
thanks,
c.
Hi Clement -
I suppose we can agree that this is an unintended effect of RH-25757 but we are now 8 years later and this is the first time that this issue converting from Rhino 5 to Rhino 7 occurs… Let’s move on.
-wim
Hi @wim, indeed. I just wanted to point out that it would have been easier for backward compatibility if the command replacement code would have considered that the old & new command can be used from the commandline as well.
thanks,
c.
Thanks clement for pointing me in the right direction.
For those using search and find this topic, use would be:
"C:\Program Files\Rhino 7\System\Rhino.exe" /runscript=" _-SetWorkingFolder ""D:\Temp"""
Note that you should always use double quotes for the path of the working folder, even when the path does not have spaces in the path name.