Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Win32::FileOp instead of netuse

by ggoebel (Sexton)
on Mar 28, 2013 at 20:50 UTC ( #1026036=note: print w/ replies, xml ) Need Help??


in reply to Windows Net Use

Way back... I would have used Win32::lanman. But apparently that module has fallen by the wayside. Looks like Jenda is now maintaining Win32::FileOp though.

While it doesn't have all the knobs and buttons, it may be close enough. It won't show you disconnected or unavailable mappings... just the ones which are currently connected.

use strict; use warnings; use Win32::FileOp; my %drive = Mapped or die $^E; for my $key (sort keys %drive) { print "$key = $drive{$key}\n"; } 1; __END__


Comment on Win32::FileOp instead of netuse
Download Code
Re: Win32::FileOp instead of netuse
by Anonymous Monk on Mar 29, 2013 at 05:34 UTC

    This does not seem to be working, it shows the following message even when i have connected ip using NET USE:

    This network connection does not exist at net-view.pl line 5.

      Can you post your code? It would help to see which line the error message is associated with.

      When I cut and paste my code snippet into a script and execute it, I get:

      c:\pub>mapped.pl
      E => \\spsrv_print\e
      
      c:\pub\>
      

      ...this is with Strawberry Perl 5.16.2 on Win7x64.

        I have used the same script as below:

        use strict; use warnings; use Win32::FileOp; my %drive = Mapped or die $^E; for my $key (sort keys %drive) { print "$key = $drive{$key}\n"; } OUTPUT:This network connection does not exist at net-fileOP.pl line 5.

        OS:Win2008 R2 Server Perl Version:This is perl 5, version 14, subversion 2 (v5.14.2) built for MSWin32-x86-multi-thread

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1026036]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (10)
As of 2014-09-02 07:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (20 votes), past polls