Managing Shared Folders

Microsoft® Windows® 2000 Scripting Guide

Computer networks evolved out of the need to share information while avoiding needless and confusing duplication. For example, suppose you have a task list that needs to be shared by a number of users. If you prefer, you can create the task list, copy it onto floppy disks, and give each user his or her own copy of the document. This works just fine, provided the task list never has to be changed.

But suppose User A completes a task, needs to add a new task, or otherwise must modify the document. User A not only has to modify his or her document but then has to copy the modified task list onto floppy disks, redistribute it, and hope that everyone else correctly updates the task list.

Needless to say, a system such as this will break down in a hurry. It is much easier, faster, safer, and more reliable to store a single copy of the task list in a central repository, and then provide users access to that document on an as-needed basis. In the Windows operating system, this central repository is typically a shared folder, a standard file system folder that is configured so that users can access it over the network.

Shared folders are an integral part of any Windows network. Therefore, it is important for system administrators to keep track of shared folders and to create new shares, modify existing shares, and delete old shares as needed. These tasks can all be carried out using WMI and the Win32_Share class. In addition, you can use Active Directory Service Interfaces (ADSI) to publish shared folders in the Active Directory® directory service, making these shares much easier for users and administrators to locate.