Solved

Who else but me?

Posted on 2004-10-01
9
200 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
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 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
 
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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

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…
This article outlines why you need to choose a backup solution that protects your entire environment – including your VMware ESXi and Microsoft Hyper-V virtualization hosts – not just your virtual machines.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

809 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