Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2011-03-07
13
Medium Priority
?
620 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 572 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 288 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Assisted Solution

by:ragnarok89
ragnarok89 earned 284 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 572 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 856 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 856 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 856 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Microsoft will be releasing the Windows 10 Creators Update in just a matter of weeks. Are you prepared? Follow these steps to ensure everything goes smoothly and you don't lose valuable data on your PC.
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…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

704 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