# Mayabatch And Path Woes

**URL:** https://forum.highend3d.com/t/mayabatch-and-path-woes/3550
**Category:** Maya
**Tags:** mel
**Created:** [October 21, 2005, 5:41pm UTC](https://forum.highend3d.com/t/mayabatch-and-path-woes/3550 "2005-10-21T17:41:40Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![mrhtford](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/m/9de053/32.png) [@mrhtford](https://forum.highend3d.com/u/mrhtford)
#### Post date: [October 21, 2005, 5:41pm UTC](https://forum.highend3d.com/t/mayabatch-and-path-woes/3550/1 "2005-10-21T17:41:40Z")

</div>

I'm running mayabatch from a makefile, to do batch importing and exporting of files.

Unfortunately,

"mayabatch file -typ "mayaBinary" -pr -ea mbs/testfile.mb"

Will save testfile.mb in   
"C:/Documents and Settings/Administrator/My Documents/maya/projects/default/mb/"

instead of "$(CURRENTDIR)/mb/", which is, IMHO, more sensible behaviour.

Is there any way of getting maya to not behave like this without resorting to using absolute paths? I really don't want to use absolute paths as that just plain sucks for various reasons.

Cheers,

MrHTFord.

---

<div class="post-metadata">

### Author: ![joojaa](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/5daacb/32.png) [@joojaa](https://forum.highend3d.com/u/joojaa)
#### Post date: [October 23, 2005, 10:21am UTC](https://forum.highend3d.com/t/mayabatch-and-path-woes/3550/2 "2005-10-23T10:21:32Z")

</div>

Mayabatch works exactly like a normal maya does. Its project directory is defined to the same default as a normal maya. So yes and no its a smarter way to work, because thetway youd be in same kind of environ as in maya, on the drwaback you have this problem.

But you cab specify the current project with the -proj flag.

For example in tested in zsh theese 2 methods work:

mayabatch -proj $PWD ...

or alternatively

mayabatch -proj `pwd` ...

most other unix type shells have similliar batcticking oprations and system var stuff so ithis would be the methodology id use in linux and osx

On windows the sytem war is named cd so

mayabatch -proj "%cd%" ...

its quoted because otherwise maya would get the wrong end of the stick if your path had space in its name

---

<div class="post-metadata">

### Author: ![mrhtford](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/m/9de053/32.png) [@mrhtford](https://forum.highend3d.com/u/mrhtford)
#### Post date: [October 24, 2005, 11:42am UTC](https://forum.highend3d.com/t/mayabatch-and-path-woes/3550/3 "2005-10-24T11:42:57Z")

</div>

Thanks very much, I've got it all working now; except for one thing...

If I don't qoute the proj string, it works fine (provided my path has no spaces in it), but if I do quote the string, then maya gives the error:-

"c:/Program Files/Alias/Maya6.0/scripts/startup/initialStartup.mel line 69: Cannot open project: "c:/work/quake4""

I tested this in both MSDOS and MSYS and both report the same error in initialStartup.mel.

FYI, here's how I'm passing it in (copied from the makefile).

CODE  
# msys paths aren't UNC paths.  
ifeq ($(OSTYPE),msys)  
 &nbsp;MAYA\_DIR = /c/"Program Files"/Alias/Maya6.0/bin  
 &nbsp;CURDIR2 = $(shell pwd -W)  
else  
 &nbsp;MAYA\_DIR = c:/"Program Files"/Alias/Maya6.0/bin  
 &nbsp;CURDIR2 = $(CURDIR)  
endif

mb/%\_anim.mb : %.md5anim  
 &nbsp; &nbsp; &nbsp; &nbsp;mkdir -p $(dir $@)  
 &nbsp; &nbsp; &nbsp; &nbsp;$(MAYA\_DIR)/mayabatch -proj \"$(CURDIR2)\" -command ...etc...etc...

MrHTFord.

---

<div class="post-metadata">

### Author: ![joojaa](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/5daacb/32.png) [@joojaa](https://forum.highend3d.com/u/joojaa)
#### Post date: [October 24, 2005, 12:27pm UTC](https://forum.highend3d.com/t/mayabatch-and-path-woes/3550/4 "2005-10-24T12:27:20Z")

</div>

from the error it seems your passing one extra quotation mark (") sequnce wich may be caused by teh fact that pwd might return a allready quoted string in wich case youd have on extra quote around. Or alternatively msys want you to use ' quotes instead of " quotes.

---

<div class="post-metadata">

### Author: ![drblacksnake](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/d/ed655f/32.png) [@drblacksnake](https://forum.highend3d.com/u/drblacksnake)
#### Post date: [October 24, 2005, 6:01pm UTC](https://forum.highend3d.com/t/mayabatch-and-path-woes/3550/5 "2005-10-24T18:01:43Z")

</div>

use c:\Progra~1\ instead ![](http://www.highend3d.com/boards/style_emoticons/<#EMO_DIR#>/smile.gif)  
also c:\Docume~1\

---

<div class="post-metadata">

### Author: ![mrhtford](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/m/9de053/32.png) [@mrhtford](https://forum.highend3d.com/u/mrhtford)
#### Post date: [October 25, 2005, 5:42pm UTC](https://forum.highend3d.com/t/mayabatch-and-path-woes/3550/6 "2005-10-25T17:42:42Z")

</div>

QUOTE(drBlacksnake @ 10/24/05, 11:01 AM)  
use c:\Progra~1\ instead ![](http://www.highend3d.com/boards/style_emoticons/<#EMO_DIR#>/smile.gif)  
also c:\Docume~1\  
[snapback]218003[/snapback]

"Program Files" works fine dude; the problem was:

CODE  
 &nbsp; &nbsp;$(MAYA\_DIR)/mayabatch -proj \"$(CURDIR2)\"

should have been:

CODE  
 &nbsp; &nbsp;$(MAYA\_DIR)/mayabatch -proj "$(CURDIR2)"

All fixed now and working; thanks alot you guys!
