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

bumgoatz

Distinguished
Feb 4, 2012
20
0
18,510
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"
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?
 

egilbe

Distinguished
Nov 17, 2011
1,417
0
19,460
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.
 

dalaran

Distinguished
Jun 7, 2011
180
0
18,710
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).
 

bumgoatz

Distinguished
Feb 4, 2012
20
0
18,510
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.
 

bumgoatz

Distinguished
Feb 4, 2012
20
0
18,510
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.
 

aishwarya1001

Reputable
Nov 9, 2015
2
0
4,510
Hi

Am getting this same error and am not able to fix it.Am trying to save my html files.but its constantly showing this error message.Please someone help.Am using sublime text.But even with notepad++ had the same issue