Compartir a través de


Close an open file or resource

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

To close an open file or resource

  • Using Shared Folders

  • Using a command line

Using Shared Folders

  1. Open Computer Management.

  2. In the console tree, click Open Files.

    Where?

    • Computer Management/System Tools/Shared Folders/Open Files
  3. Do one of the following:

    • To disconnect all open resources, on the Action menu, click Disconnect All Open Files.

    • To disconnect one open file or resource, in the details pane, right-click the file name, and then click Close Open File.

    • To disconnect multiple open files or resources, press the CTRL key while clicking the file names, right-click any selected file name, and then click Close Open File.

Note

  • To open Computer Management, click Start, click Control Panel, double-click Administrative Tools, and then double-click Computer Management.

Using a command line

  • Open Command Prompt.

  • Type:

    net fileID**/close**

Value Description

net file

Displays the names of all open shared files on a server and the number of file locks, if any, on each file.

ID

The dynamically assigned ID of the shared resource.

/close

Closes the shared resource and removes file locks. Type this command from the server where the file is shared.

Notes

  • To open a command prompt, click Start, point to All programs, point to Accessories, and then click Command prompt.

  • You can use the openfiles command to determine the file ID of the shared resource. For more information, see Related Topics.

  • To view the complete syntax for this command, at the command prompt, type:

    net help file

Caution

  • If you close open files or resources, users might lose data. You may want to warn connected users before you close an open file or resource. For more information, see Related Topics.

Notes

  • You must be logged on as a member of the Administrators group, Server Operators group, or Power Users group to complete this procedure. If your computer is connected to a network, network policy settings might also prevent you from completing this procedure.

  • You can use Shared Folders to manage shared resources on both local and remote computers. For information about how to connect to another computer, see Related Topics. With Windows Explorer and the command line, you can manage shared resources on your local computer only.

  • When you administer another computer remotely, your connection appears as an open named pipe. It cannot be closed.

  • File sharing options may be limited if simple file sharing is enabled. For more information about simple file sharing, see article Q304040, "Description of File Sharing and Permissions in Windows XP," in the Microsoft Knowledge Base.

Information about functional differences

  • Your server might function differently based on the version and edition of the operating system that is installed, your account permissions, and your menu settings. For more information, see Viewing Help on the Web.

See Also

Concepts

Shared Folders overview
Microsoft Management Console
Openfiles
Connect to another computer

Other Resources

Net file
Send a console message to all connected computers
Send a console message to a computer that you are managing
Send a console message to all connected computers