Win32::NetResource

The Win32::NetResource module allows you to manage shared resources on a network, such as printers, disks, etc. Two data structures are used to provide or store information for many of the NetResource functions. The first is the share_info hash. This hash contains parameters for setting up a share, using the following structure:

%share_info = (
      netname       => "name of share",
      type          => "type of share",
      remark        => "a string comment",
      permissions   => "permissions value",
      maxusers      => "the max number of users",
      current-users => "the current number of users",
      path          => "the path of the share",
      passwd        => "password, if required"
);

A netresource data structure contains information about the shared resource or device. It has the following structure:

%netresource = (
      'Scope'       => "Scope of a resource connection (see list below for 
                        values)",
      'Type'        => "The type of resource (see list below)",
      'DisplayType' => "How the resource should be displayed (see list
                                       below)",
      'Usage'       => "How the resource should be used",
      'LocalName'   => "Name of the local device the resource is connected 
                        to",
      'RemoteName'  => "Network name of the resource",
      'Comment'     => "Comment string",
      'Provider'    => "Provider of the resource"
);

The first three elements of the netresource hash contain values described in the following lists. The Scope value can be one of the following:

RESOURCE_CONNECTED

Resource is already connected

RESOURCE_REMEMBERED

Resource is reconnected each time the user logs on

RESOURCE_GLOBALNET

Resource ...

Get Perl in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.