Solved

Who else but me?

Posted on 2004-10-01
9
194 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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…
Is your company's data protection keeping pace with virtualization? Here are 7 dynamic ways to adapt to rapid breakthroughs in technology.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

760 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

21 Experts available now in Live!

Get 1:1 Help Now