Sign in with
Sign up | Sign in
Your question

The process cannot access the file because it is being used by...

Tags:
Last response: in Windows 7
Share
May 3, 2012 7:31:17 PM

Hi Forums,

I am getting this error all the time with Windows 7. I open a text file I want to
edit, then go to save my changes and I get this error:

"The process cannot access the file because it is being used by another process"



I have full admin rights, running Win7 Ultimate x64 SP1. From a bit of research I have seen where many others have been experiencing this problem or something similar too. The only "fix" (that doesn't work all the time) is to close explorer.exe and then restart it to "release the handle"? Anyway, this is not acceptable for all the money and time I spent upgrading/configuring this new OS from XP -where I never had this problem- and seriously cuts down my productivity.

Is there a fix for this? Has Microsoft even acknowledged this as a bug yet? I can duplicate this scenario the second or third time I try to edit/save/delete a text file and I know that explorer.exe is the problem or a big part of it in any case. I don't want to go back to XP x64 but having to deal with this headache 10-20 times a day is just too much to ask.

Thanks!

Fyi:The file here is a game's map script & has to be saved to a .pk3 and then loaded into the program's root before it can run so i know othing else is running the file. No apps running in taskmngr either. I've worked 1000's of hours editing code like this on XP and had no probs. I'm at a loss here

More about : process access file

a b $ Windows 7
May 3, 2012 8:58:18 PM

bumgoatz said:
Hi Forums,

I am getting this error all the time with Windows 7. I open a text file I want to
edit, then go to save my changes and I get this error:

"The process cannot access the file because it is being used by another process"
http://i.imgur.com/EL0ef.png


I have full admin rights, running Win7 Ultimate x64 SP1. From a bit of research I have seen where many others have been experiencing this problem or something similar too. The only "fix" (that doesn't work all the time) is to close explorer.exe and then restart it to "release the handle"? Anyway, this is not acceptable for all the money and time I spent upgrading/configuring this new OS from XP -where I never had this problem- and seriously cuts down my productivity.

Is there a fix for this? Has Microsoft even acknowledged this as a bug yet? I can duplicate this scenario the second or third time I try to edit/save/delete a text file and I know that explorer.exe is the problem or a big part of it in any case. I don't want to go back to XP x64 but having to deal with this headache 10-20 times a day is just too much to ask.

Thanks!

Fyi:The file here is a game's map script & has to be saved to a .pk3 and then loaded into the program's root before it can run so i know othing else is running the file. No apps running in taskmngr either. I've worked 1000's of hours editing code like this on XP and had no probs. I'm at a loss here



Hello,

Well that's strange indeed. It's almost like your code is executing before you even do anything with it. Does this only occur with TXT files?

What exactly do you do to make this error occur? Create a file, save it, then open it, edit it, then save it again and thats where you get the issue?

Have you tried using a free notepad editor?

http://editpadlite.com/

It's free to use. You might want to try this before trying to troubleshoot your issue.

Edit: Also where are you saving this file to? A network drive? A USB key? Your desktop?
m
0
l
a b $ Windows 7
May 3, 2012 9:02:00 PM

You don't happen to have more than one operating system installed, do you?
A dual boot or multi-boot system like both WinXP and Win7. Or Win7, Linux, and Windows 8?
m
0
l
Related resources
May 3, 2012 9:25:42 PM

I just had this problem with writing to a text file with a VB program I was writing. I had to close the Visual Studio, reboot the pc and then It would write. I thought it was just a bug with my code, but that's the exact error I got.
m
0
l
May 3, 2012 9:40:12 PM

I usually use ProcessExplorer to diagnose those kind of issues.

It has a Find Handle or DLL feature that lets you search for a file name and all file handles currently open on files matching that name will be listed, you can then see which process has the file open, you can either kill the process, or forcefully close the handle which can solve the issue without rebooting.

Edit : It can also be a security issue, if writing a file to a system folder (C:\Program Files*, C:\Windows\*) windows can get very picky, try running your text editor as an administrator next time it happens (right-click -> Run as administrator).
m
0
l
a b $ Windows 7
May 3, 2012 10:20:36 PM

Restart to PC, try again.

This can happen when to have multiple user on one PC, and someone else is still logged in.

Or when there was an error running an application, and it was closed inproperly.

Many other reasons.
m
0
l
May 3, 2012 10:35:54 PM

Hi, thanks for the replies.

===========>

@Chainzsaw

1. Yes, so far this only occurrs with text edits. I use Notepad++ as well and the same thing happens.
2. "What exactly do you do to make this error occur? Create a file, save it, then open it, edit it, then save it again and thats where you get the issue? " Correct
3. Saving to desktop.

===========>

@WR2

1. Only running one OS

===========>

@dalaran

1. I have full admin rights and the only user on this machine.

===========>


Found this in MS forums: http://tinyurl.com/6q3c6a7

Seems to be an issue long standing and a bug inherent with Windows 7.

There has been no "official" statement from MS acknowledging this bug hence a patch or fix release is unlikely. Some users in the thread above have offered "fixes" but they are way too time consuming and inefficient in regards to workflow productivity. This shouldn't be an issue one has to deal with when purchasing a new OS that's supposed to be a pinnacle achievement in technology in the first place. How could MS leave such a glaring bug with their poster-child OS? Totally bs.
m
0
l
a b $ Windows 7
May 3, 2012 10:42:49 PM

Do you have the same symptoms when you boot up in Safe Mode?
m
0
l
a b $ Windows 7
May 4, 2012 1:53:02 AM

In Safe Mode Notepad++ works as expected?
m
0
l
May 5, 2012 10:02:59 AM

My approach to this was flawed. The way I was testing if this occurs with different file extensions was starting out with the original .scr file and if it wouldn't save without error I would rename it to .txt, .cfg, .urm, .rtf etc. But...starting from a freshly created .txt, I can edit that file and/or rename it to anything and it will behave correctly until I renamed it to .scr ..then the problem starts again. It's explorer.exe locking it, seeing it as an "operating file" (screensaver) which it's not obviously just has the extension.


I can copy over text from an .scr (one of my scripts) and create a new .txt file and work with it with no problems. But as soon as I rename it to .scr it locks again.

This happens no matter what directory I have the file in.

I shouldn't have to boot into safe mode just to edit a file.
m
0
l
May 5, 2012 1:57:08 PM

*Fixed. Changed program association with .scr extension from screen saver to notepad++. Argg, so simple. Was driving me crazy..lol
m
0
l
a b $ Windows 7
May 5, 2012 5:08:26 PM

Good job troubleshooting to a successful conclusion.
m
0
l
!