[Closed] problem running script from command line
I’m having trouble with something that should be really straight forward, at least according to the help docs. I simply want to launch max and run a script from command line:
3dsmax.exe -U MAXScript test.ms
I can launch Max without any problems, but the test.ms script never runs. (It’s a one line script to load a max file.) Are there environment settings, path configurations, or something along those lines that would prevent a script from being located or run?
My test.ms is in my Scripts directory. I’ve tried locating it elsewhere, but so far, no luck.
I suspect I’m overlooking something very obvious. Or at least I hope so, because this should be an easy task.
Always use explicit paths (usually UNC is best) when using command-line tools.
3dsmax.exe -U Maxscript "\\Path\folder\file est.ms"
Your current code would need the test.ms file in the same folder as the 3dsmax.exe file.
-Eric
I thought it might be path related also.
However, I tried using explicit paths as well as putting test.ms in the same directory as my 3dsmax.exe but this has not worked.
I’m using 32bit Max 2009 on a Vista machine, if it makes any difference.
Eric,
Thanks for responding. I got some help from one of my coders, and it was related to how the DOS shell was opened. I’d initially opened the shell by typing cmd and then navigating to the Max directory to run my command line exe. But when I opened the DOS shell directly from the folder (shift+right-clicking in the Explorer window and then opening a DOS shell) that worked. No obvious difference between the two methods jumps out at me, so I’m not sure what accounts for the discrepency.
Thanks again.
You could also try running it all from a batch file that includes the full path to the .exe, .ms, etc, I have never had problems doing that. I wonder if it is like HiddenDOSCommand, where startpath is defined where you open the cmd from, or something like that.
-Eric