in reply to Win32:NetResource problem

Put a use Net::Resource ; at the top of your code.

Doing that and using your code worked for me.

Now this might not be doing what you think. What it will do, is tell you the UNC path of any of your mapped drives, similar to typing net use at the command line. It will not expand your local shares into a UNC path!

From the NetResource doc:
Enumerating all resources on a particular host is done like this
# # This example displays all the share points exported by the local # host. # use strict; use Win32::NetResource qw(:DEFAULT GetSharedResources GetError); if (GetSharedResources(my $resources, RESOURCETYPE_DISK,{ RemoteName = +> "\\\\" . Win32::NodeName() })) { foreach my $href (@$resources) { print "-----\n"; foreach(keys %$href) { print "$_: $href->{$_}\n"; } } }


"Nothing is sure but death and taxes" I say combine the two and its death to all taxes!

Replies are listed 'Best First'.
Re: Re: Win32:NetResource problem
by arkamedis21 (Acolyte) on Aug 08, 2002 at 18:20 UTC
    i do have a

    use Win32::NetResource;

    on top of my code. The touble is that the GetUNCName() works for mapped network drives, just not for local shares for some reason.