>Hello all,
>
>These are my steps:
>1.) CD (my folder location)
>2.) CLOSE TABLES ALL
>3.) CLOSE DATABASES ALL
>4.) CD (new folder location)
>5.) ERASE (my folder location\*.*)
>
>Error 3: File in use
>
>I use a program called Unlocker so I can see what has files locked at certain times. I use Unlocker on "my folder location" and it says that dbcxmgr.vct and dbcxmgr.vcx appear to be in use in "my folder location".
>
>Does anyone know of a way that I can force close dbcxmgr.vct and dbcxmgr.vcx in "my folder location" since "CLOSE ALL" AND "CLOSE DATABASES ALL" doesn't seem to get the job done?
>
>OR maybe even how to delete an entire folder with a lot files in it whether it's being used by something else or not.
>
>Thanks in advance!
Matt,
In VFP8 and up you can put erase command into TRY/CATCH block, so it would not give you an error.
Alternatively, you can try deleting each file individually (in try/catch as well) - this way you would be able to delete everything except for used files.
If it's not broken, fix it until it is.
My Blog