I've got a routine that deletes a folder and everything in it. After deleting all the files, the last thing it does is:
if not Windows.RemoveDirectory(pname) then
raise EInOutError.Create(SysErrorMessage(GetLastError));
Unfortunately, I tend to get an error from this if I have an open window in Windows Explorer displaying the folder. The error says the folder is not empty, which is not true. Is there any way to override this, perhaps forcing the window to close?
In case it makes a difference, I'm on Vista Home Premium 64.