One quick idea. Perhaps Windows has set the current directory to your application folder and this locks the directory in your case. Try to use "Call DLL..." to execute the SetCurrentDirectory Windows API and set the current directory to another folder.

Friedrich