There are two different categories of open files on a system. Since the days of Windows NT, the operating system has supported the capability to view the files that are open from shared folders. This is useful when you want to see who is accessing files on a file server, especially if you need to take the system down for maintenance and you want to notify the impacted users.
First seen in Windows XP and supported in Windows Server 2003 is the ability to view all open files on a system (not just shared folders). To use this feature, you first have to enable support for it. The reason this isn't enabled by default is because there is a slight system-wide performance impact when tracking all open files.
To view the open files from shared folders, do the following:
From the Administrative Tools, open the Computer Management snap-in.
In the left pane, expand System Tools → Shared Folders → Open Files.
To close an open file, right-click on it in the right pane and select Close Open File.
> net file
The output from that command displays open files and their associated ID. Using this ID, you can close a specific file:
> net file
To view all open files, first enable support for it:
> openfiles /local on
You'll need to reboot the system before this setting takes effect. At that point, you can see open files using this command:
<ServerName> option to target a
remote server. Similar to the
file command, you can close any
open file by running this command:
> openfiles /disconnect /id
You can also disconnect all the files open by a particular user:
> openfiles /disconnect /a