Thanks for that. I did try the Perl in the link but sadly I did not have the required Win32::DriveInfo.
However I did use your google search and found a page which explained where the drive letters are in the registry.
The following Perl gives what I wanted.
It works for XP but I do not know about other Windows OS
use strict "vars"; my (%dletters, $return_code, $return_message, $jl); sub drive_letters_find($$$) { ##------------------------------------------------------------------- ## this gets the drive letters and their paths for the current PC # it returns a has where key is drive letter - value is it contents ## ------------------------------------------------------------------ my ($ref_dletters, $ref_return_code, $ref_return_message) = @_; my ($pp, $k, $key, $vals, $CurrVer, %vals); use Win32::Registry; $pp = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Map Net +work Drive MRU\\"; $$ref_return_code = $main::HKEY_CURRENT_USER->Open($pp, $CurrVer); if($$ref_return_code == 1) { $$ref_return_message = 'drive letters found'; $CurrVer->GetValues(\%vals); foreach $k (keys %vals) { $key = $vals{$k}; $ref_dletters->{$$key[0]} = $$key[2]; } } else { $$ref_return_message = "Could not open regsitry $pp\n\n"; } } drive_letters_find(\%dletters, \$return_code, \$return_message); print "\nafter drive_letters_find\nresult code <$return_code> message +<$return_message>\n"; if($return_code == 1) { print "mapped drive letters found\n"; foreach $jl (sort {$a cmp $b} keys %dletters) { print "letter <$jl> path <$dletters{$jl}>\n"; } }

In reply to Re^2: Finding mapped drive data by merrymonk
in thread Finding mapped drive data by merrymonk

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.