The caching feature of Shared Folders ensures that users have access to shared files even when they are working offline without access to the network. You can also use Shared Folders or Share and Storage Management to enable BranchCache on shared resources. The BranchCache feature in Windows® 7 or Windows Server 2008 R2 enables computers in a branch office to cache files downloaded from this shared folder, and then securely serve the files to other computers in the branch.

You can also configure Offline Files and BranchCache by using Group Policy. For a complete list of Group Policy settings, see the Microsoft Web site (http://go.microsoft.com/fwlink/?LinkId=142412).

Important

When you create a shared folder, offline availability is enabled by default, which means that secure folders can be stored offline on potentially non secure computers. For increased security, do not allow users to store files offline. If you do, consider encrypting the operating system volume using Windows® BitLocker™ Drive Encryption. For more information, see the BitLocker Drive Encryption page of the Microsoft Web site (http://go.microsoft.com/fwlink/?LinkId=141534).

Set caching options for a shared folder

To set caching options for a shared folder by using the Windows interface
  1. Open Computer Management.

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

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

  4. In the results pane, right-click the shared folder, and then click Properties.

  5. On the General tab, click Offline Settings, configure the offline availability options as appropriate and then click OK.

Offline availability options

You can select one of the following offline availability options for each shared folder:

  • Only the files and programs that users specify are available offline. This is the default option when you set up a shared folder. By using this option, no files or programs are available offline by default, and users control which files and programs they want to access when they are not connected to the network.

    • Enable BranchCache Enables computers in a branch office to cache files downloaded from this shared folder and then securely serve the files to other computers in the branch office. To enable BranchCache, you must first install the BranchCache for network files role service by using Server Manager.

  • No files or programs from the share are available offline. This option blocks Offline Files on the client computers from making copies of the files and programs on the shared folder.

  • All files and programs that users open from the share are automatically available offline. Whenever a user accesses the shared folder or volume and opens a file or program in it, that file or program will be automatically made available offline to that user. Files and programs that are automatically made available offline will remain in the Offline Files cache and synchronize with the version on the server until the cache is full or the user deletes the files. Files and programs that are not opened are not available offline.

    If you select the Optimized for performance check box, executable files (EXE, DLL) that are run from the shared folder by a client computer are automatically cached on that client computer. The next time the client computer runs the executable files, it will access its local cache instead of the shared folder on the server.

    Note

    The Offline Files feature must be enabled on the client computer for files and programs to be automatically cached. Additionally, the Optimized for performance option does not have any effect on client computers using Windows Vista or newer.

To set caching options for a shared 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 Yes.

  3. Type one of the following commands to specify caching for this shared folder:

    net share <sharename> /cache:manual
    net share <sharename> /cache:BranchCache
    net share <sharename> /cache:documents
    net share <sharename> /cache:programs
    net share <sharename> /cache:none
    

    For example, to allows users to identify the documents and programs they want to store offline from the shared folder named myshare, type:

    net share myshare /cache:manual
    

Value Description

Net share

Manages shared folders.

<sharename>

The name of the shared folder.

/cache:manual

Allows users to identify the documents and programs they want to store offline. Corresponds to the following option in the Windows interface: Only the files and programs that users specify are available offline.

/cache:BranchCache

Enables BranchCache and manual caching of documents on the shared folder. Corresponds to the following options in the Windows interface: Enable BranchCache and Only the files and programs that users specify are available offline.

/cache:documents

Automatically stores documents offline. Corresponds to the following option in the Windows interface: All files and programs that users open from the share are automatically available offline.

/cache:programs

Automatically stores documents and programs offline. Corresponds to the following option in the Windows interface: Optimized for performance.

/cache:none

Prevents users from storing documents and programs offline. Corresponds to the following option in the Windows interface: No files or programs from the share are available offline.

Notes
  • To view the complete syntax for this command, at the command prompt, type: net help share
  • To display information about a shared folder, type: net share <sharename>