Hi
> As you can see you should store the result of CurrentDir and change it back before you leave.
Yeah, indeed you really MUST store the result of CurrentDir() and restore it before your application terminates, because this directory lock is not owned by your application, it is owned by the shell your application is started from (or the Workbench, if started by Workbench) and so you will corrupt your system if you simply free this lock and may meet the Guru...
Noster