Solved

Who else but me?

Posted on 2004-10-01
9
197 Views
Last Modified: 2010-04-14
Ola,

When trying to delte a file I get this msg ( something like it ) "Cant delete file, file in use", even though I am SysAdmin.
How can I tell what process or who is using that file?

And when it is a process I cant kill normally, how do I eradicate that process so that I can delete the file in use anyway and restart my sytems normally :-)

0
Comment
Question by:DaFou
9 Comments
 
LVL 57

Assisted Solution

by:Pete Long
Pete Long earned 100 total points
ID: 12200353
Can’t Delete a File

You need permissions to delete a file are you a member of the Administrators group?
(you need a minimum of {modify} to delete.
**********
1.      Try to take ownership of the file. Right click the file > Select the security Tab
Select properties > Select Advanced > Select Owner
Find the User or group you wish to give ownership to and select > Click apply
Now try and delete the file
http://support.microsoft.com/default.aspx?scid=kb;en-us;268019
**********
2      Is it telling you the filename is too long? Then Delete the file in DOS mode
Start >Run >cmd {enter}
Navigate to the folder the file is in, i.e. if its in c:\folder\anotherfolder\file, type "cd c:\folder\anotherfolder" {enter} The command prompt should change to let you know you are in
the correct directory. Type "dir /x" {enter}
The offending file will be listed like (filena~1.xxx)
Take note of the name and type "del filena~1.xxx" {enter}
**********
3.      Is the file flagged as ‘System’? Start > Run > type CMD >Click OK
Navigate to the folder in which the file resides (i.e. cd c:\folder\folder\ {enter})
Type attrib -r -s -a -h filename.extension {enter}
Del filename.extension {enter}
**********
4.      Is the file in use? If either the OS or another program is using the file you cannot
delete it You can with ZAP Included with the Microsoft SMS 2.0 Resource Guide and the
Microsoft BackOffice Resource Kit 4.5. or you can download it here
http://helpdesk.kixtart.org/KixUtilsTasks.asp
WARNING make sure you know what your deleting first!
**********
5.      If your hard drive is formatted with FAT32 you can boot with a boot disk and Delete
the file from DOS. (del filename.extension) If your hard drive is formatted with NTFS you
can boot with a boot disk and, if you lucky enough to have a copy of NTFSPro from http://www.sysinternals.com/ntw2k/freeware/ntfsdospro.shtml you can boot to DOS mount the
NTFS volumes and delete it from there.
**********

**Other Options**
Use this on the file/folder in question
http://www.jrtwine.com/Products/DelFXPFiles/

Use GiPo@MoveOnBoot
http://www.gibinsoft.net/gipoutils/bin/moveonb.exe
Instructions for use http://www.download-free-games.com/removing_dm_exe.htm

Try using "KillBox" on the file
http://www.broadbandmedic.com/download/VbStuff/TheKillBox.zip

Try using TAKEOWN from the resource kit to force ownership and delete the file
http://www.dynawell.com/support/ResKit/win2k.asp

"Access Denied" When You Delete Folders from a Mounted Drive
http://support.microsoft.com/default.aspx?scid=kb;en-us;243514
0
 
LVL 2

Author Comment

by:DaFou
ID: 12200601
PeteLong,

thx for your input:

1, ok cool
2, no not that. the file name is not too long
3, please tell me more.. how do I tell if a file is system or not?
4, thx alot. That will help alot.. Buit before I start zapping atuff please tell me how do I tell what / who is using the file i am about to zap..
5. no fat.. otherwise I would have no problems..
0
 
LVL 2

Assisted Solution

by:demingj1
demingj1 earned 150 total points
ID: 12200662
pskill (a very small app from sysinternals [i think, maybe winternals]) will kill ANY process from commandline given it's PID.  You can get it's pid from task manager or use the app to kill the process by name matching.  I recommend any sysadmin have this app available, it is very small and free.

try to track down and kill the process that is keeping that "file in use" then you can delete it.
0
 
LVL 2

Author Comment

by:DaFou
ID: 12200856
When searching for *pskill*.* I find nothing.. Please provide additinal info.

And how do I tell what process is keeping what file in use?
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
LVL 86

Accepted Solution

by:
jkr earned 200 total points
ID: 12200936
Use the Process Explorer (http://www.sysinternals.com/ntw2k/freeware/procexp.shtml) to see what application is using that file.
0
 
LVL 2

Assisted Solution

by:demingj1
demingj1 earned 150 total points
ID: 12201290
http://www.sysinternals.com/ntw2k/freeware/pstools.shtml

for the pstools suite, however you only need pskill (and the app mentioned from jkr above to tell which process has the file in use)
0
 

Assisted Solution

by:EFA
EFA earned 50 total points
ID: 12203098
Sorry I didn't read the above. Try to see the administrative tools\computer management\shared folders\open files.
0
 
LVL 2

Author Comment

by:DaFou
ID: 12419763
SOrry I was away on this thread so long. ill try all suggestions this week and by next week i want to have the points asigned
0
 
LVL 2

Author Comment

by:DaFou
ID: 12441863
Hmm imagine a text file blah.txt  
now it is possible for that file to be in use by a process like a editor or something.

When i try to delete that file i get a message stating i cant delete the file becuase it is is use. But i cant see that file in the Task Manager.
I see alot of processes and one of those processes is using that file.. But how do i find out what process it is?

Thats my real problem.
0

Featured Post

[Webinar] Disaster Recovery and Cloud Management

Learn from Unigma and CloudBerry industry veterans which providers are best for certain use cases and how to lower cloud costs, how to grow your Managed Services practice in IaaS clouds, and how to utilize public cloud for Disaster Recovery

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Visual C++ Runtime Error on Windows 2000 Server 2 1,484
P2V Windows NT/2000 SP4 3 1,820
Windows 2000 Server to 2008 upgrade 8 513
Get process CPU use Win2000 server in visual basic 12 136
NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

910 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

23 Experts available now in Live!

Get 1:1 Help Now