my $remote = '10.10.10.10'; 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" } }