Another Newbie question - Error Code=1

General discussions and questions.
Bret Karson
Posts: 14
Joined: Thu Mar 15, 2018 9:53 am

Re: Another Newbie question - Error Code=1

Post 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%
Bret Karson
Posts: 14
Joined: Thu Mar 15, 2018 9:53 am

Re: Another Newbie question - Error Code=1

Post 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.
Bret Karson
Posts: 14
Joined: Thu Mar 15, 2018 9:53 am

Re: Another Newbie question - Error Code=1

Post by Bret Karson »

I can confirm that it is only the cmd-files inside the \software_setup\bin that needs editing.
User avatar
timurhai
Site Admin
Posts: 916
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: Another Newbie question - Error Code=1

Post by timurhai »

Hm, strange, as this is in quotes too

Code: Select all

"%APP_DIR%\3dsmaxcmd.exe" %*
Timur Hairulin
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).
Bret Karson
Posts: 14
Joined: Thu Mar 15, 2018 9:53 am

Re: Another Newbie question - Error Code=1

Post 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.
Post Reply