[SOLVED] Batch file problems

Hi Guys,

I am using a batch file to load a %1 variable .stl file created by another program into grasshopper. It’s working with a controlled path without spaces:

cd C:\Users\khann\Desktop
“C:\Program Files\Rhino 6\System\rhino.exe” /nosplash /runscript="-grasshopper editor load document open C:\Users\khann\Desktop\Path_without_spaces\Grasshopper_file.gh" “%1”

Unfortunately I need to load the grasshopper file from a network drive with spaces in the path:

cd C:\Users\khann\Desktop
“C:\Program Files\Rhino 6\System\rhino.exe” /nosplash /runscript="-grasshopper editor load document open C:\Users\khann\Desktop\Path with spaces\Grasshopper file.gh" “%1”

I appreciate any help. Thanks!

Best regards,
Kevin

Hi Kevin,

You’ll need to pass the path inbetween double quotes as well.
Not sure though how the ‘overall quotes’ will get parsed.

*“C:\Program Files\Rhino 6\System\rhino.exe” /nosplash /runscript="-grasshopper editor load document open "C:\Users\khann\Desktop\Path without spaces\Grasshopper file.gh" " “%1”*
1 Like

Hi Willem,

Still having issues unfortunately.

.bat file reads as follows:

echo postproc %1
cd G:\Shared drives\Research and Development\Process Automation\Grasshopper research\Server\batch file\Network postprocess
“C:\Program Files\Rhino 6\System\rhino.exe” /nosplash /runscript="-grasshopper editor load document open “G:\Shared drives\Research and Development\Process Automation\Grasshopper research\Server\batch file\Network postprocess\example_load_save_and_exit_v2.gh” " “%1”

I’ve attached the command history and the error. Thanks again for the assistance.

Did%20not%20load%203dm%20history Did%20not%20load%203dm

Hi Willem,

Apologies my mistake its working now. Thanks for the help. I realised after I posted that I had made as a stupid mistake.

Best,
Kevin

1 Like