How can I tell who has which files open on a machine?

A. To view which user has which files open, use the net-file command, which displays information in the form of ID, path, username, and number of locks. For example, I ran the net-file command and received the following results:

ID         Path                                    User name            # Locks
-------------------------------------------------------------------------------
9          D:\index.lnk                            savillj               0
11         D:\john.lnk                             savillj               0
23         D:\www.savilltech.com\images\me.gif     savillj               0
27         D:\www.savilltech.com\images\mcse.gif   savillj               0
31         D:\www.savilltech.com\images\mvp.gif    savillj               0
35         D:\www.savilltech.com\images\40179.JPG  savillj               0
39         D:\www.savilltech...\goldeneye.gif      savillj               0
43         D:\www.savilltech...\Rita1sml.jpg       savillj               0
47         D:\www.savilltech...\Rita2sml.jpg       savillj               0
49         D:\www.savilltech.com\me.html           savillj               0
The command completed successfully.

You can also use the net-file command to delete a file lock. Enter

net file 47 /close

to remove this lock. To use the net-file command, you must have the server service running on the machine. From the Start menu, select Settings, Control Panel, then Services to see if the service is running. You can also use the Server Control Panel applet on the server that houses the file share. A freeware utility called Open File List (OFL) is available from http://www.merxsoft.com/ and provides more information.

The best third-party applications that I’ve found are NTHandle (a command-line file-use utility) and NTHandleEx (a GUI version of NTHandle). Both utilities are available from http://www.sysinternals.com.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish