PDA

View Full Version : OT:Sharing violation when deleting folder in WinXP


Asmala
February 11th, 2006, 05:32 AM
Quite often when I try to remove a folder in WinXP, I get the error message: Cannot remove folder "folder name": There has been a sharing violation. The source or destination file may be in use. However, I can remove all of the files inside the folder, but not the folder itself. Also, I noticed that the folder can be deleted if I kill the explorer.exe process or restart the computer.

Had anybody else experienced this? Today I decided to find out what was causing the problem. I found what is the problem, but not why it's happening. The problem is that the explorer.exe has an file handle open in the folder. When I forced the handle to close, I could remove the folder as usual.

So, has anybody any ideas why the explorer.exe leaves an open handle there? Any other explanations than the obvious: XP sucks http://forum.shrapnelgames.com/images/smilies/wink.gif

Kamog
February 11th, 2006, 05:43 AM
That's happened to me and like you said, I reboot the computer and it then lets me delete the folder. I have no idea what causes it.

Thermodyne
February 11th, 2006, 01:51 PM
Depends on the environment that the system is setup for. Where does the folder reside in the directory structure? And what is the name of the folder? Is the system in a Domain or Workgroup?

Asmala
February 12th, 2006, 03:19 PM
Thermodyne said:
Depends on the environment that the system is setup for. Where does the folder reside in the directory structure? And what is the name of the folder? Is the system in a Domain or Workgroup?



I think it doesn't matter what is the name of the folder or where the folder is. That sharing violation bug has happened many times and only pattern I've noticed is that very often there have been images in those folders. So perhaps it's something to do with XP's preview property.

However I found a great program, Process Explorer (http://www.sysinternals.com/Utilities/ProcessExplorer.html), which can be used to close those open file handles. No need to restart any more.

Thermodyne
February 12th, 2006, 04:41 PM
Shouldn’t be an issue with the preview indexing, unless a third party editor has modified the process. Got anything like Photoshop installed? Photoshop can really have an impact on windows if your not real careful with the install settings. Kodak is another one that can really make a lot of undocumented changes.

Fyron
February 12th, 2006, 05:17 PM
There is a long-standing bug in XP with AVI files being marked as in use forever, which there is a registry hack to bypass. Wonder if there is the same thing for image files?

Asmala
February 12th, 2006, 08:03 PM
Imperator Fyron said:
There is a long-standing bug in XP with AVI files being marked as in use forever, which there is a registry hack to bypass. Wonder if there is the same thing for image files?



I think it's not the same thing since I can remove all the files from the folder but not the folder itself.

Ed Kolis
February 12th, 2006, 09:38 PM
Are you running a multi-user system? Perhaps another user is logged on and left an explorer window open... http://forum.shrapnelgames.com/images/smilies/tongue.gif

Parasite
February 13th, 2006, 04:18 AM
If you have Windows Explorer open and looking inside that directory, it is marked as being used and will not delete. Possibly another window is open to it while you were deleting files.

Asmala
February 13th, 2006, 07:04 AM
I'm not running a multi-user system nor having Explorer windows open.

Most often this happens when I transfer images from my digital camera. I use memory card reader and copy images from card to hard disk using Explorer. When I've copied images, I look through them (using IrfanView) and delete poor shots. After that when I try to rename the folder I get the sharing violation error. However I can move all the images to a new folder, but I can't rename, delete or move the original folder.

Suicide Junkie
February 13th, 2006, 09:46 AM
Sounds like your camera software dosen't clean up after itself.
At least it is squatting in the corner instead of barfing all over your file system http://forum.shrapnelgames.com/images/smilies/wink.gif

Asmala
February 13th, 2006, 02:19 PM
Suicide Junkie said:
Sounds like your camera software dosen't clean up after itself.
At least it is squatting in the corner instead of barfing all over your file system http://forum.shrapnelgames.com/images/smilies/wink.gif



I'm not using any camera software. I use memory card reader and Ctrl-C Ctrl-V to copy images from the card.