Click here to Skip to main content
15,893,668 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi
I have a .bak file i copied it to the test server, Now when I tried to delete it from the main server i got the below error:

"Error deleting file or folder
Cannot delete [name of folder]: It is being used by another person or program. Close any programs that might be using the file and try again.

Please provide me solution.

Thanks
Posted

try to shutdown the task that uses the file - after that you can restart the task -
 
Share this answer
 
Comments
tusharN 22-Aug-13 6:21am    
Ya i have checked all and checked about permissions also.. but still its not working
The error message is pretty explicit: "It is being used by another person or program. Close any programs that might be using the file and try again."
With a database, that means SQL server, SSMS, VS or your application could be holding a reference to the file, and thus making it "in use" and not deletable. Try closing them all, and if your application opens the file directly or any reason, make sure that all streams, handles and so forth referring to the file are released or disposed when you are finished with them.
 
Share this answer
 
Comments
tusharN 22-Aug-13 6:21am    
Ya i have checked all and checked about permissions also.. but still its not working
OriginalGriff 22-Aug-13 6:28am    
It's not a permissions problem: the file is in use. That means that an application or service has opened the file, and has not closed it yet - so you need to look and see which one it is.
How are you copying it?
OriginalGriff 22-Aug-13 6:29am    
You may find this useful as well:
http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900