View Full Version : Open and Export file from dos cmd

10 October 2010, 02:51 AM
Hey guys,
How would I open a maya file and export its contents from a dos cmd?
So far I have
maya -file "c:/location/mayafile.mb"
which opens the file from the dos prompt.

and to export from mel I have
file -force -options "v=0" -type "mayaAscii" -pr -ea "C:/exportlocation/"

But I cant figure out how to do both at once from the cmd prompt.
Any help would be appreciated.

10 October 2010, 04:01 AM
i've never done it but you could source the script with -script or -command maybe. this is just what came up with maya -help

-v prints the product version and cut number
-batch for batch mode
-prompt for interactive non-gui mode
-proj [dir] look for files in the specified project dir
-command [mel command] runs the specified command on startup
-file [file] opens the specified file
-script [file] sources the specified file on startup
-log [file] copies stdout and stderr messages to the specified file
(use complete file name)
-recover recover the last journal file
(use 'Render -help' for more options)
-optimizeRender [file] [outfile]
optimize maya file efficient for rendering
purposes, and put result in outfile
(use 'maya -optimizeRender -help' for more options)
-archive [file] displays a list of files required to archive
the specified scene.
-noAutoloadPlugins do not auto-load any plug-ins.
-help prints this message

10 October 2010, 06:02 AM
got it

The little (') quotes were throwing me for some time.

maya -file "c:\tmp\mayatest.mb" -command 'file -force -options "v=0" -type "mayaAscii" -
pr -ea "C:/tmp/"'


you can also throw in a -prompt after that line to make it load up without the user interface.. very cool

CGTalk Moderation
10 October 2010, 06:02 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.