Discussion Locked

Lock file faulty, can't delete files

0 helpful
20 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

On a Win2k server I have several files that I'm not able to delete. They are all old userfiles, the user has left the company and the files shold be removed. However when I try to delete them I get the message that the file cannot be deleted becauseit is in use. (lockfile placed on it?) This is the same both locally and over the network.
The files are not in use. I've tried to boot to safe mode and delete them, no effect. I've tried to take ownership (as administrator) that I can do, but still not remove them. I tried to do this from the commandline, then replacing all single spaces in filenames with ?, no effect, still can't delete them. All the files have one thing in common: they have been created on another Windows 2000 in a different domain an been sent by e-mail or restored from a backup file. Therefore it is quite possible that the problem originated on the foreign machines, not here. I don't know. Still it is a large number of files from several different machines, some running Win9x.

20 replies

by tksolway

You have to take ownership of the dirs with your admin account. Then you have the rights to delete the files.

by cactus pete

I've also seen this happen if the filenames are very long, with non-standard characters. Try renaming the file - and you may need to do that from a DOS prompt.

It's not terribly liekly, but I've seen it. So good luck.

by bra-k

If the user has left the company, then why don't you just temporaly create his logon account again and try to delete these files under his ID.

Bra-k

by hpoppe

The accounts under which the files were made were on another system. Also, if the account has been deleted, it can't be recreated by making a new account with the same username / password. When the new (identical) account is made, a new SIDwill be created and this will be different from the original account. It is the SID that is actually used for authenticating.

by dbowlin

I've not tried this. But, if the files are in a shared folder, try going to computer management and looking in the open files folder, and disconnecting it.

Good luck,
Dan

by dbowlin

Here is something else to try. Start the computer with the recovery console, and delete the files from there.

by hpoppe

I've tried that too now, but still I cet the "access is denied" so this did not work either.

by edrossius

Try this:

Just to be sure Windows is not locking your files, launch a reboot of your machine.
Once in administrator session, go to the Advanced Security permissions.
In the Owner tab, perform a Take Ownership on the specified files (do not forget to click on the "Replace Owner on subcontainers and objects" check box).
Get back to normal security permissions and add for example Domain Admins / Full Control in the list. Click on the Advanced button, select the Domain Admins entry, select the "Reset permissions on all child objects...." check box, and finally click on Apply.

My practice: If you can't remove the parent folder, start deleting from bottom to top, thus finishin by the parent folder which should be empty at that time.

Hope this will help...

by cactus pete

One of the things MS suggests is to run CHKDSK /F on the volume. They say the file is sorrupt and the index can't update its "pending deletion".

by Former member

A shot in the dark, but write a logon batch file that deletes the specific files. This might be effective, as I beleive the script runs before the effective security policy is applied (I could be wrong, and if so, no harm done). remembr to add the /Q switch to the DEL command

and it goes something like this

DEL /Q c:\docume~1\alluse~1\desktop\*.* specify each file individually, and you could ad a pause after each del line to see if it effective, or what problems you encounter...

another alternative, although a bit draconian, would be to change the file system from NTFS to FAT32, delete the files, and then back to NTFS. The FAT32 file system does not support the same level of secrity as NTFS

by jbianrosa

I have the same problem. Folders were stacked 38 deep and four across in each. Using the command window I went to the last folder by using the dir /x command to get the DOS name. From the last folder, I was able to use the del *.* /F for the files and back out of the folder and rd 'foldername' /s.
I am now four folders away from the root and cannot delete anymore. Error - 'The process cannot access the file because it is being used by another process' - which is is not being used.

This discussion is closed to new replies.