Compartilhar via


Stop Sharing a Folder or Drive

Applies To: Windows Server 2008

You can stop sharing a folder or drive by using the Shared Folders Microsoft Management Console (MMC) snap-in or by using a command prompt.

Important

Users connected to a shared folder are disconnected when you stop sharing it. Users may lose data if you stop sharing a folder containing an open shared file without warning. When possible, notify users before you stop sharing a folder.

Stop sharing a folder or drive

  • Using the Windows interface

  • Using a command line

To stop sharing a folder by using the Windows interface

  1. Open Computer Management.

    • In Windows Vista: Click Start, click Control Panel, click System and Maintenance, click Administrative Tools, and then click Computer Management.

    • In Windows Server 2008: Click Start, click Control Panel, double-click Administrative Tools, and then click Computer Management.

  2. If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Continue.

  3. In the console tree, click System Tools, then click Shared Folders, and then click Shares.

  4. In the details pane, right-click a shared folder, and then click Stop Sharing.

    To stop sharing multiple files, press the CTRL key while clicking the file names, right-click any one of the selected files, and then click Stop Sharing. This removes shared network access to the selected files.

To stop sharing a folder by using a command line

  1. To open an elevated Command Prompt window, click Start, point to All Programs, click Accessories, right-click Command Prompt, and then click Run as administrator.

  2. If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Continue.

  3. Type:

    net share <sharename> /delete.
    

    For example, to stop sharing a folder called myshare, type:

    net share myshare /delete
    
Value Description

Net share

Creates, deletes, or displays shared folders.

<sharename>

The network name of the shared folder.

/delete

Stops sharing the folder.

Note

To view the complete syntax for this command, at the command prompt, type: net help share

Additional references

Command-Line Syntax Notation