The process cannot access the file because it is being used by another
process.
the file is 1.txt and there are no programs open but visual studio
I'm trying to rename this file, but it won't let me. How can I see what's
accessing this file at the moment?
Thanks.
Vitaly Zayko - 28 Dec 2005 09:47 GMT
If you are on XP or 2000:
open ControlPanel->AdministrativeTools->ComputerManagement. Then under
"Shared Folders" click "Open files" subtree. It should show which
process is the locker.

Signature
Vit Zayko
Willy Denoyette [MVP] - 28 Dec 2005 10:22 GMT
> If you are on XP or 2000:
> open ControlPanel->AdministrativeTools->ComputerManagement. Then under
> "Shared Folders" click "Open files" subtree. It should show which process
> is the locker.
Not at all, this is for files opened from a remote client through a network
session.
Willy.
Willy Denoyette [MVP] - 28 Dec 2005 10:24 GMT
> The process cannot access the file because it is being used by another
> process.
[quoted text clipped - 5 lines]
>
> Thanks.
If only VS is running, it's VS that is accessing the file, are you sure
there is no application started from within VS that has the file open?
Willy.
Rahul Goel - 28 Dec 2005 12:06 GMT
Check all of the services running on ur PC
Willy Denoyette [MVP] - 28 Dec 2005 14:24 GMT
> Check all of the services running on ur PC
Why?
Willy.
sune - 28 Dec 2005 12:35 GMT
You can use SysInternals' freeware ProcessExplorer (
http://www.sysinternals.com/Utilities/ProcessExplorer.html ) to search
for open handles and other useful stuff.
Jani Järvinen [MVP] - 28 Dec 2005 14:31 GMT
> You can use SysInternals' freeware ProcessExplorer (
> http://www.sysinternals.com/Utilities/ProcessExplorer.html ) to search
> for open handles and other useful stuff.
Or even easier, their Handle utility for command-line use. This is one of my
favorites.
http://www.sysinternals.com/Utilities/Handle.html

Signature
Regards,
Mr. Jani Järvinen
C# MVP
Helsinki, Finland
janij@removethis.dystopia.fi
http://www.saunalahti.fi/janij/
David Wilson - 28 Dec 2005 19:42 GMT
This often happens with me after viewing a file or folder's properties
using Explorer on XP Professional. Sometimes for no apparent reason,
Explorer appears to lose track of the open file descriptor, and I must
log off completely (or kill explorer.exe) to delete the file or folder
in question.
As with what other people have said, the SysInternals utilities prove
extremely valuable when figuring out problems such as this.
David.
> The process cannot access the file because it is being used by another
> process.
[quoted text clipped - 5 lines]
>
> Thanks.