in reply to Controlling the directory location on exit.
Is there any way to force it to not restore or restore the path I want??
I don't think so. For security reasons, programs are not able to mess with their parent's environment. On win32, using cd within a batch file may (or may not) work; if so, you can possibly write a batch file that reads the output of your script and calls cd if appropriate. Other than that, I don't think there's a way to do it.