Solved

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

Posted on 2011-03-07
13
557 Views
Last Modified: 2012-05-11

I get this error when a system process tries to use the file. but i know the file is not being used (i logged off and logged back in) and also edited the file just fine.

what else could this error message indicate?

thanks
0
Comment
Question by:anushahanna
  • 6
  • 3
  • 2
  • +2
13 Comments
 
LVL 2

Accepted Solution

by:
grossac earned 143 total points
ID: 35060611
You said you logged off them back on, but have you tried rebooting?  Sometimes the system accounts will hold processes during a log off.
0
 
LVL 8

Assisted Solution

by:Sean Scissors
Sean Scissors earned 72 total points
ID: 35060621
Can you be a little more specific as to what kind of file and what program you may be using it in or something. It could be perhaps the program needs to be manually ended through the task manager but it all depends on the situation. A little more specifics would be very helpful.
0
 
LVL 6

Author Comment

by:anushahanna
ID: 35060659
i am using a sql server package to open a text file and read it and do some processing. everything upto that point works and then the above error gets thrown at. the complaint is that the text file is being used somewhere else.
0
 
LVL 8

Assisted Solution

by:ragnarok89
ragnarok89 earned 71 total points
ID: 35060663
If this is a one time thing, download "file unlocker". It's a free App, and great and removing any kind of file lock.
0
 
LVL 2

Assisted Solution

by:grossac
grossac earned 143 total points
ID: 35060673
Is something generating the text file?  If so, are you closing out the text file object?
0
 
LVL 6

Author Comment

by:anushahanna
ID: 35060749
the text file is already there - it is not being generated but being read from
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 6

Author Comment

by:anushahanna
ID: 35060755
ragnarok89,  hope we can resolve it as it is, before having to use a tool..
0
 
LVL 23

Assisted Solution

by:wdosanjos
wdosanjos earned 214 total points
ID: 35061581
You can also try the handle utility.  It can tell you who is the process that's locking a file.  It's less then 500K and it's available for free at:

http://technet.microsoft.com/en-us/sysinternals/bb896655

From the command prompt just enter:

handle yourfilename

Open in new window


Here is the help:
C:\>handle -?

Handle v3.45
Copyright (C) 1997-2011 Mark Russinovich
Sysinternals - www.sysinternals.com

usage: handle [[-a [-l]] [-u] | [-c <handle> [-y]] | [-s]] [-p <process>|<pid>] [name]
  -a      Dump all handle information.
  -l      Just show pagefile-backed section handles.
  -c      Closes the specified handle (interpreted as a hexadecimal number).
          You must specify the process by its PID.
          WARNING: Closing handles can cause application or system instability.
  -y      Don't prompt for close handle confirmation.
  -s      Print count of each type of handle open.
  -u      Show the owning user name when searching for handles.
  -p      Dump handles belonging to process (partial name accepted).
  name    Search for handles to objects with <name> (fragment accepted).

No arguments will dump all file references.

Open in new window


I hope this helps.
0
 
LVL 6

Author Comment

by:anushahanna
ID: 35063388
good tool - it says "no handles"

what could that mean? permission issue?
0
 
LVL 23

Assisted Solution

by:wdosanjos
wdosanjos earned 214 total points
ID: 35063512
It could be. You must have admin privileges to run handle.  

Please try handle without any parameters or just with a partial name of your file.
0
 
LVL 6

Author Comment

by:anushahanna
ID: 35063718
no, i meant- i have privilege to run handle and what it is saying is there is no block or hold on it.

perhaps the process that is trying to use the file does not have permissions?

i read into the log, and where it is failing when it is trying to move the file from one location to another.
0
 
LVL 23

Assisted Solution

by:wdosanjos
wdosanjos earned 214 total points
ID: 35069462
If the process does not have permissions on the file or on the destination folder, it will fail with an 'Access Denied' type of exception.

Another possibility is that the process has the file open when it tries to move it, but by the time you check the file is already closed.

Do you have a specific error message or piece of code around this issue?
0
 
LVL 6

Author Comment

by:anushahanna
ID: 35077407
wdosanjos- that is a good insight - thank you..

the title of this post is the exact error given by SQL Server task when it is work on the file. but the error is clearly OS related.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Many companies are making the switch from Microsoft to Google Apps (https://www.google.com/work/apps/business/). Use this article to learn more about what Google Apps has to offer and to help if you’re planning on migrating to Google Apps. It is …
The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now