Solved

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

Posted on 2011-03-07
13
567 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
I don't know if many of you have made the great mistake of using the Cisco Thin Client model with the management software VXC. If you have then you are probably more then familiar with the incredibly clunky interface, the numerous work arounds, and …
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
Viewers will learn the different options available in the Backstage view in Excel 2013.

867 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

21 Experts available now in Live!

Get 1:1 Help Now