Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Identifying Windows file share names

by Discipulus (Abbot)
on Oct 29, 2018 at 19:43 UTC ( #1224874=note: print w/replies, xml ) Need Help??

in reply to Identifying Windows file share names

Hello CaffeinatedCatatonic and welcome to the monastery and to the wonderful world of Perl!

I doubt i understood your question: if so try to explain your needs in a more accurate way.

From what I understand you connect to a server share, let's say \\\share_name rigth? Now you want to know this share what path holds on the target server? Like c:\stuff\shared

If my assumptions are correct you can wrap some perl code around wmic /node: share get name,path command.


my $remote = ''; my $share = 'share_name'; # connect to the share.. ... # get info on the share from remote system open my $cmd, "wmic /node:$remote share get name,path|" or die; while (<$cmd>){ chomp; my ($got_name, $got_path) = split /\s+/, $_; if ($got_name eq $share){ print "share [$share] at $ip is remotely: $got_path\n" } }


There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2019-11-15 02:26 GMT
Find Nodes?
    Voting Booth?
    Strict and warnings: which comes first?

    Results (80 votes). Check out past polls.