Solved

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

Posted on 2011-03-07
13
604 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
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
 
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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
Suggested Courses

626 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