# Batch file modifying tool bar then failing to exit

Hi,
I am trying to make a batch file that is starting rhino through the command line with the \RunScript option which will adjust it’s toolbar (opening a custom one and displaying it) then close so that it will be there when they open rhino at a later time. When I try to do this though it is not exiting out of rhino if the script involves the toolbar command. A quick example of it not opening is as simple as rhino /runscript="-_Toolbar Enter -Exit" which should start the tool bar command, exit the tool bar command and then exit Rhino.

Grant

Any Info on this ?

I dont know why -Exit doesnt work but i’ve just tried:

"C:\Program Files\Rhinoceros 5 (64-bit)\System\Rhino.exe" /nosplash /runscript="_line 0,0,0 10,0,0 -exit"


and it seems to work. If i change it too -_Toolbar _enter it stops again. Hmpf.

Yeah that is pretty much what we are seeing we are able to render through the command line however setting the toolbar makes it stop.

Instead of creating a batch file you can also create a button in rhino that does the same:
It opens rhino files Renders it and saves the render Closes 3dm file and opens the next.

https://github.com/mcneel/rhinoscript/blob/master/BatchRender.vbs

That would work if we were trying to render with it. What I am trying to do is to create a batch file that will copy over a toolbar (.rui) file from our file server then open rhino open the toolbar display the toolbar then close. That way whenever we need to set up a new machine all we have to do is run the file and it should be set up.

The actual command I am running is

“C:\Program Files\Rhinoceros 5 (64-bit)\System\Rhino.exe” /nosplash /runscript="-_Toolbar C O “Path\to\our\file.rui” _Enter T tools S tools Y _Enter _Enter -Exit"

And this is never exiting rhino.

Sorry I’ve tried to create something but can’t get it too work either. Anyone else can help here?

I’m not sure why the Exit command is so finicky some times. Something to do with the state of Rhino, message queue, etc.

Anyway, attached is a VBScript that you can run outside of Rhino that should do what you want. Just rename the file’s extension to .VBS and following the instructions in the (text) file. You can have a batch file call this if needed.

The script is (probably) more complicated than it needs. If first tries to launch Rhino 5 64-bit. If it fails, it tries to launch Rhino 5 32- bit.

Once Rhino is running, it just runs some commands before exiting.

TestGrant.txt (1.3 KB)

Thanks Dale,
That seems to work some of the time. Occasionally when I try to use it it just opens up Rhino and doesn’t run the commands.

Grant

I would like to ask where I can find the Batch File of System Time in Toolbar?, thanks

I’m not sure I understand what you are looking for. Can you clarify this? Thanks!