Start Maya from the command line
 
 
 

If you start Maya from the command line, there are various startup options you can specify. For example, you can open a file at startup using the -file flag:

maya -file filename
maya.exe -file filename

To see the available startup flags, type the following:

maya -help

Running Maya in batch or prompt mode

Maya can be run in several distinct modes that affect its overall manner of operation, two of which allow you to execute Maya commands without the interface, -prompt and -batch (on Windows, use mayabatch.exe instead of maya -batch).

Additional Maya startup flags

These are additional flags you can use when starting up Maya from the command line (maya on Linux/Mac OS X; mayabatch.exe on Windows).

-archive [file]

Displays a list of files required to archive the specified scene and then exits Maya.

-command [mel command]

Runs the specified command on startup. The command should be enclosed in double quotes to protect any special characters, including spaces.

-log [file]

Copies all standard output and error messages (those that normally appear in the Output Window) to the specified file (use complete file name).

This flag is for Windows only.

-noAutoloadPlugins

Do not auto-load any plug-ins.

-optimizeRender [file] [outfile]

Processes the specified scene file to optimize it for rendering, puts the result in outfile and then exits. Use maya -optimizeRender -help for more options. See -optimizeRender flags.

-proj [dir]

Looks for scene files in the specified project directory.

-recover

Recovers the last journal file.

-script [file]

Sources the specified file (which is expected to be a MEL script) on startup.

-v

Displays the product version and cut number, and then exits.

-3

Enable Python 3000 compatibility warnings.
Note
  • The -batch command is not used for batch rendering. Instead, use the Render command. However, -batch does check out a render-only license instead of a full Maya license.
  • On Windows, type mayabatch when using the -batch flag. The mayabatch command runs within the command prompt window, whereas the maya command starts a separate window.
  • The -render flag is now obsolete. Use the Render -r command instead.

-optimizeRender flags

Use this command to optimize the specified scene file for rendering, send the result to an output file and then close Maya.

maya -optimizeRender [options] [file] [outfile]

The available [options] are:

-botRes [int]

Specify a minimum file texture resolution that will cause BOT files to be produced. For example, specifying “-botRes 256” means that all file textures bigger than 256x256.will be converted to BOT format.

-botLoca [name]

Specify the directory in which BOT files reside. The default is in the same directory as the original file.

-help

Displays all the flags available for use with -optimizeRender.

-noBOT

Does not create BOT files.

-noCleanup

Does not clean up useless data.

-tessFreeze [startframe] [endframe] [byframe]

Calculates NURBS tessellation that gives the best image quality based on the camera projection.