How to Debug Sharing Violations?

T

TC

I get sharing violations all the time. A typical error is something like
"Cannot rename Folder1: There has been a sharing violation. The source or
destination file may be in use." These errors occur for run-of-the-mill data
files and folders which don't seem to be open anywhere. The errors are
frustrating; I would like to figure out what is going on so I can fix it.

Each time I get the error, I assume some behind-the-scenes program is
manipulating the file/folder in question, but how can I learn more? Is there
any way to view a list of locked files and the applications holding them?

-TC
 
C

Carrie Garth \(MVP\)

Hi TC,

There are a variety of diagnostic tools that you can use to try and determine what
process has the open handle. For a tool with a GUI, see Sysinternals "Process
Explorer". And for a command-line tool see Sysinternals "Handle" or Microsoft's
"Open Handles".

- Process Explorer
Copyright © 1998-2002 Mark Russinovich
Find out what files, registry keys and other objects processes have open, which DLLs
they have loaded, and more. This uniquely powerful utility will even show you who
owns each process.
http://www.sysinternals.com/ntw2k/freeware/procexp.shtml

- Handle
Copyright © 1997-2001 Mark Russinovich
This handy command-line utility will show you what files are open by which processes,
and much more.
http://www.sysinternals.com/ntw2k/freeware/handle.shtml

- Open Handles
For information on Microsoft's "Open Handles" tool (oh.exe) see the following
Microsoft Knowledge Base Article, section titled: "Cause 2: The File Is Being Used",
and the "additional information" article: KB172710.

KB320081 - You Cannot Delete a File or a Folder
http://support.microsoft.com/?scid=320081

NOTES:

- The OH Tool discussed in KB172710 can be found on the Windows 2000 Professional
Resource Kit companion CD. Or you can download it as "Windows 2000 > Technical
Resources > Resource Kits: Free Tool Downloads". For more information, see the
following Microsoft Knowledge Base Article:

KB274305 - Free Windows 2000 Resource Kit Tools for Administrative Tasks
http://support.microsoft.com/?scid=274305

- The gflags.exe program discussed in KB172710 is one of the Support Tools included
on the Windows 2000 CD (see Windows 2000 Help topic "To install Windows 2000 Support
Tools").

--
Carrie Garth, Microsoft MVP for Windows 2000
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- c x g

: "TC" <q AT w DOT e>
: wrote in message : Sent: Sunday, August 03, 2003 05:01 PM
: I get sharing violations all the time. A typical error is something like
: "Cannot rename Folder1: There has been a sharing violation. The source or
: destination file may be in use." These errors occur for run-of-the-mill data
: files and folders which don't seem to be open anywhere. The errors are
: frustrating; I would like to figure out what is going on so I can fix it.
:
: Each time I get the error, I assume some behind-the-scenes program is
: manipulating the file/folder in question, but how can I learn more? Is there
: any way to view a list of locked files and the applications holding them?
:
: -TC
:
:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top