-U switch not working in cmd line

-U switch not working in cmd line

Anonymous
Not applicable
901 Views
6 Replies
Message 1 of 7

-U switch not working in cmd line

Anonymous
Not applicable

Hi, 

 

I have a .bat file that will work opening any .max file in the same folder.  

for /r %%v in (*.max) do start %%v  

works great.

 

I have read the help topic on running MAXScript from CMD line saying:

-U MAXScript rendercams.ms

However I can't get these two working together -  so I can run the .bat file, it open the max file in the same folder and run a certain  script.

 

Any Ideas why this will not work, and how to get around this please?

 

Adam

0 Likes
Accepted solutions (1)
902 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable

(Also tried -MXS) doesn't work either..

0 Likes
Message 3 of 7

drew_avis
Autodesk
Autodesk

What version of Max?  Can you post a copy of the bat file you are using?

 

Drew

 

 



Drew Avis
Content Experience Designer
0 Likes
Message 4 of 7

Anonymous
Not applicable

Hi mate,

 

I'm using 2018.

 

The first bat file attached will do what I need and open any .Max file in the same folder.

 

The second one I though may do the same be also run any desired script (based in info I found on the Autodesk help).

 

Thanks

 

Ad

 

0 Likes
Message 5 of 7

Anonymous
Not applicable

Sorry will not post with the bat files attached

0 Likes
Message 6 of 7

drew_avis
Autodesk
Autodesk
Accepted solution

Hi, I've had a look at your bat file, and I think I have a working version:

 

for /r %%v in (*.max) do (
start "" "<path>\3dsmax.exe" -u MAXScript test.ms %%v 
)

The issue was your "start %%v" invokes the default program for %%v (a .max file), but that doesn't pass parameters correctly (in this case -u).

 

Substitute <path> for your path to 3dsmax.exe.

 

Hope that helps,

Drew



Drew Avis
Content Experience Designer
0 Likes
Message 7 of 7

Anonymous
Not applicable

Excellent, thanks.

Works great now!

0 Likes