Made sure you you store the current path in a variable before changing path.
myAppPath = CurDir
chDir mamedir
ShellAndWaitA "mame.exe"
chDir = myAppPath
As HC said, goto fe.donkeyfly.com. I just made you a programmer, you can access the programming sections.