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).
maya -batch -file someMayaFile.mb -command "file -save"
mayabatch -file someMayaFile.mb -command "file -save"
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. |
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]