Spaces in path cause program to fail

May 27, 2011 at 8:46 PM

I am having a hell of a time getting Map Generator to parse my command line. I am using a batch file that uses a couple envvars to generate the final command line. Here's the actual command that ends up being run:

terrariamaptool.exe -terraria "C:\Program Files (x86)\Steam\steamapps\common\terraria\" -world "C:\Users\greg.laabs\Documents\My Games\Terraria\Worlds\world1.wld" -output "C:\Users\greg.laabs\Documents\My Games\Terraria\Worlds\map" -blocksize 16,16 -layer drawwalls,drawbackgroundwater,drawforegroundwater,drawbackgroundtiles,drawforegroundtiles -zoomlevels 0.03125,0.0625,0.125,0.25,0.5,1 -mapdata�

And here's the error I get:

Failed to parse arguments:

Unknown option: Games\Terraria\Worlds\world1.wld -output C:\Users\greg.laabs\Documents\My
Parameter name: options

I cannot for the life of me figure out what is going on. I am enclosing the the parameters in quotes but it's acting as if I am not.

May 27, 2011 at 8:47 PM

Of course I solved it 10 seconds after I break down and make this post.

It appears that the trailing backslash on the "terraria" parameter was escaping the closing quote, which is what caused all of the issues. Removing the trailing slash solved the issue.