How do I find out what opened the file I try to remove on Windows 2000 Server?

2

1

Possible Duplicates:
How do I delete a 'locked' file?
Tool to determine what has locked a file

While trying to remove an empty directory on Windows 2000, I am told that I can't do that, because the file is possibly opened.

As mentioned in "How do I delete a 'locked' file?", I tried the Unlocker, but it didn't seem to find anything. Also, I am not able to use the Process Explorer.

So on Windows 2000 server, how do I found out the process/program which opened the folder, and how do I make it unopen it?

EDIT: With a bit of luck I found out that once I killed one of the httpd process running (for a totally unrelated reason), I was able to remove the folder. The question are now: why didn't net file pick it up? And how would I have been able to detect the right process in the first place?

Eldros

Posted 2011-08-11T11:08:39.203

Reputation: 125

Question was closed 2011-08-11T14:22:50.527

Are you able to reboot the machine? Did you? – Ƭᴇcʜιᴇ007 – 2011-08-11T12:17:02.337

@techie: I saw the thread you linked and mentioned I tried the solution without success. Furthermore it has a windows-xp tag, and I have the problem on windows 2000. As to me being able to reboot the machine, a web application is running on the machine, so if there were a solution which didn't require me to reboot the machine it would be good. – Eldros – 2011-08-11T12:23:40.520

@Eldros I know you said you couldn't install process explorer, but it doesn't really install anything you just run it and so long as you accept the license it just runs. There's no install routine or rebooting. – Col – 2011-08-11T12:35:34.507

@Col, on their site, they state that the application is on Server-side for Windows 2003 or higher. Furthermore, the exe is complaining about a missing dll to be able to run.

– Eldros – 2011-08-11T12:39:45.617

@Eldros is it possible that someone has the folder open in a remote desktop or from the server console? In case you hadn't noticed I'm starting to clutch at straws now. – Col – 2011-08-11T12:42:28.537

@Col no, it is a generated folder, and outside from me and the web application, noone as access to the machine. – Eldros – 2011-08-11T12:45:10.803

@Eldros I guess I'm officially out of ideas now, hopefully someone else out there will come up with something for you. Good luck. – Col – 2011-08-11T12:49:47.153

@Col let us continue this discussion in chat

– Eldros – 2011-08-11T13:01:17.757

Answers

1

It may be the file is open from elsewhere, if you go to a command prompt and type

net file

this will list files that are open from remote workstations with id numbers to close a file the command is

net file  <ID No> /close

Col

Posted 2011-08-11T11:08:39.203

Reputation: 6 995

The only entry I have doesn't correspond to the folder I want to delete... But nice command, didn't knew about it. – Eldros – 2011-08-11T12:17:33.177

out of interest, i'm on xp, and just tried opening one file from another via file sharing. did net file on each of them, and it said "There are no entries in the list" so i'm probably not doing something right, but the method doesn't seem to work there – barlop – 2011-08-11T12:19:04.343

I'm not sure it works under non server OS's although I would have expected it to. It definitely works on all server OS's from 2000 onwards. – Col – 2011-08-11T12:20:19.913

I just tested under XP pro and it seems to work, certainly for the excel file I tested with. It may be that certain apps don't hold the file open. – Col – 2011-08-11T12:28:39.260

The question is indeed: Is the file locked in @barlop case. – Eldros – 2011-08-11T12:30:10.667

It's also possible that if he's running XP home it may not be included – Col – 2011-08-11T12:36:39.530

It does display them now, I don't know why it didn't in the last test, maybe I forgot something/didn't do something. – barlop – 2011-08-11T15:11:47.143