Page 2 of 2

Re: Another Newbie question - Error Code=1

Posted: Thu Mar 15, 2018 1:39 pm
by Bret Karson
This is from the setup_3dsmax.cmd file, if I am supposed to put double quotes into this file, where exactly do I put them? All paths seem to use double quotes already.
rem Source general for all soft directives:
call %CGRU_LOCATION%\software_setup\setup__all.cmd

For /F "Tokens=*" %%I in ('dir /b "C:\Program Files\Autodesk\3ds Max*"') Do set "MAX_LOCATION=C:\Program Files\Autodesk\%%I"

set "PATH=%CGRU_LOCATION%\plugins\max;%PATH%"

set APP_DIR=%MAX_LOCATION%
set APP_EXE=3dsmax.exe

rem Define location:
set locate_file=%CGRU_LOCATION%\software_setup\locate_3dsmax.cmd
if exist %locate_file% call %locate_file%

set MAX_LOCATION=%APP_DIR%

Re: Another Newbie question - Error Code=1

Posted: Thu Mar 15, 2018 2:44 pm
by Bret Karson
Making progress.
After trying to figure out the previous cmd files I noticed that inside \software_setup\bin there are respective cmd-files as well.

They contain a line with an %APP_DIR% variable.

If I change this to an absolute path, from:
"%APP_DIR%\3dsmaxcmd.exe" %*
to:
"C:\Program Files\Autodesk\3ds Max 2017\3dsmaxcmd.exe" %*
the job is successfully launched and rendering.

Likewise if I change aerender.cmd and afterfx.cmd in the same way After Effects will render fine.

So from what I can tell the issue is due to spaces in search paths, but when evaluating the %APP_DIR%\app.exe variable it is not evaluated within double quotes, hence why an absolute path within double quote works, but a variable within double quotes does not.

Re: Another Newbie question - Error Code=1

Posted: Thu Mar 15, 2018 2:56 pm
by Bret Karson
I can confirm that it is only the cmd-files inside the \software_setup\bin that needs editing.

Re: Another Newbie question - Error Code=1

Posted: Thu Mar 15, 2018 4:07 pm
by timurhai
Hm, strange, as this is in quotes too

Code: Select all

"%APP_DIR%\3dsmaxcmd.exe" %*

Re: Another Newbie question - Error Code=1

Posted: Thu Mar 15, 2018 4:44 pm
by Bret Karson
Maybe it is the variable itself that is causing this issue. Like, if it refers to a path that contains spaces, the variable will only yield "C:\Program".

In that case it does not matter if %APP_DIR% is contained within double quotes, because the variable will still be "C:\Program", and the resulting path will be "C:\Program\executable.exe", wich is a file that does not exist.