MAME itself does at least some auto-correction on paths. Just replace all instances of \ or / with the locally correct version. As long as you don't try and get any trickier that works in a lot of cases.