|
-
Mar 16th, 2013, 11:52 AM
#1
Thread Starter
Lively Member
The Process Cannot Access the File Because It Is Being Used By Another Process
I am getting this error at this line:
My.Computer.FileSystem.RenameFile(objListViewItem.Text, InputBox("Please enter the new name of the file."))
Sometimes I get the error, sometimes it works. No open windows do seem to be using this file I'm using. Thanks in advance.
-
Mar 16th, 2013, 02:54 PM
#2
Frenzied Member
Re: The Process Cannot Access the File Because It Is Being Used By Another Process
More the likely the file is open, even though you dont see it in a window. I thiunk if you go to task manager you might see a process with the file in question
I had an old xp computer that would never seem to shut down word correctly, the program wasnt open when i looked for oepn windows but sure enough in taks manager you could see it still running.
The fact that you "sometimes get the error would lead me to think that is what is happening. Is this a file that you open somewhere else in your program? have a look in your task manager
if so try to explicitly close it
-
Mar 16th, 2013, 05:28 PM
#3
Thread Starter
Lively Member
Re: The Process Cannot Access the File Because It Is Being Used By Another Process
I do not use this file in any other place in my program. After I restarted my computer, everything seemed to be fine. Like you said, I suspect it to be a process, not an open window. However, I don't know any way of checking if a file is in use, and if so, in what process. If you know any way to find if/what process is using a file, please tell me. Thank you so much!
-
Mar 16th, 2013, 06:55 PM
#4
Frenzied Member
Re: The Process Cannot Access the File Because It Is Being Used By Another Process
Well what file is it? it must some how being used?
-
Mar 16th, 2013, 07:01 PM
#5
Thread Starter
Lively Member
Re: The Process Cannot Access the File Because It Is Being Used By Another Process
The file name was not a constant, so I don't really remember which file it was. However, the problem seems to be fixed. Again, if someone has a way to find out what process is using what files, I'd gladly appreciate.
Just found a solution, works great: http://windowsxp.mvps.org/processlock.htm
-
Mar 16th, 2013, 07:22 PM
#6
Frenzied Member
Re: The Process Cannot Access the File Because It Is Being Used By Another Process
-
Mar 17th, 2013, 06:12 AM
#7
Thread Starter
Lively Member
Re: The Process Cannot Access the File Because It Is Being Used By Another Process
Appearantly, it was some process, because after I restarted my computer, it was gone. But thanks for everyone's help.
-
Mar 22nd, 2013, 06:50 PM
#8
Frenzied Member
Re: The Process Cannot Access the File Because It Is Being Used By Another Process
 Originally Posted by TheBilly102030
Appearantly, it was some process, because after I restarted my computer, it was gone. But thanks for everyone's help.
please mark resolved
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|