Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
jtarchie
what version of perl are you running? How did you install the module. PPM is the best way to get modules installed. If you want a cludge way to do this, you could always do
open(NETVIEW, "net view|") or die "$!"; print NETVIEW;
Here's some code that i found while doing a search on netResource:
use Win32::Lanman; $odir = "C:\\TEMP\\SHARES"; if (!-e "$odir"){mkdir ($odir, 0777)|| die "Unable to create $odir";} %stype = (1,'Printer',-2147483648,'Default',0,'File', -2147483645, 'InterProcess Communication'); @servers = &getservers; foreach (@servers) { unless(Win32::Lanman::NetShareEnum("\\\\$_", \@shares)){next;} $output = ("$odir\\$_.txt"); open(OUTFILE, ">$output") || die ("cannot open output file ", $output +, "\n"); foreach $share (@shares) { print OUTFILE "Server = $_\n"; print OUTFILE "Name = ${$share}{'netname'}\n"; print OUTFILE "Type = $stype{${$share}{'type'}}"; $lc = chop ${$share}{'netname'}; if ($lc eq "\$"){print OUTFILE " (hidden)\n";}else{print OUTFILE "\n +"} print OUTFILE "Path = ${$share}{'path'}\n"; print OUTFILE "Remarks = ${$share}{'remark'}\n\n"; } close OUTFILE; } sub getservers { unless(my $domain = Win32::DomainName){print "Unable to obtain the do +main name.";} my ($PDC, $domain, @servers1, @S1, @S2); unless($domain = Win32::DomainName){print "Unable to obtain the domai +n name.";} foreach (SV_TYPE_DOMAIN_CTRL, SV_TYPE_DOMAIN_BAKCTRL, SV_TYPE_SERVER_ +NT) { unless(Win32::Lanman::NetServerEnum( '', $domain, $_, \@S1)){print " +Unable to obtain information on $_ .";} foreach (@S1){push( @S2, ${$_}{'name'})} push(@servers1, sort @S2); undef @S2; } undef ($domain, $PDC); undef @S1; return(@servers1); # Returns the server list }
cheers.
Ray

In reply to Re: trouble with Win32::NetResource by RayRay459
in thread trouble with Win32::NetResource by thealienz1

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others lurking in the Monastery: (5)
    As of 2014-08-30 09:27 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The best computer themed movie is:











      Results (292 votes), past polls