Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2011-03-07
13
Medium Priority
?
631 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 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
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
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

Technology Partners: 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!

Question has a verified solution.

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

Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
pc, laptop  monitor connection configurations
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…

577 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