I think we've got some fine suggestions in this thread. I was thinking about another problem that could rear its ugly head: how do you find the drives that you want to do complete searches upon?

Windows drive letter assignments can move around for various reasons. So I hacked out this thing to get a listing of the drives on my system. You might find something like this helpful? I'm sure that there is some better / faster way to do this as this is slow, but it appears to work... Have fun if its helpful..

Update: As per testing from Ratazong, code works but you have to have admin rights to run fsutil. So I went searching for another way...

I don't think that the "vol" command requires any special rights to run as it appears in the standard list of command when you type "help" at the command prompt. Using the ouput is a bit trickier because you have to use information from both STDERR and STDOUT but from that info you can glean the 3 possibilities (a) device exists but no media in it, (b) this is something that looks like a hard drive, (c) no device exists. Code shown below. Not quite as much info as the fsutil code, but probably close enough for most purposes.

#!/usr/bin/perl -w use strict; #find Windows drive letters and type of drive my $result = `fsutil fsinfo drives`; my @letters = ($result =~ /[A-Z]{1}:/g); my %drive_types; foreach my $ltr (@letters) { my $result = `fsutil fsinfo drivetype $ltr`; $result =~ s/\r\n$//; my $type = ($result =~ /-\s+(.*)/)[0]; $drive_types{$ltr}=$type; } foreach my $drive (sort keys %drive_types) { print "$drive is a $drive_types{$drive}\n"; } __END__ prints: A: is a Removable Drive C: is a Fixed Drive D: is a CD-ROM Drive E: is a Removable Drive F: is a Removable Drive H: is a Fixed Drive I: is a Fixed Drive
my %drives; foreach my $drive ('A'..'Z') { my $all = `vol $drive: 2>&1`; next if ($all =~ m/system cannot find the path/); $drives{$drive} = ($all =~ /^\s*(.*)/)[0]; #first line } foreach my $drive (sort keys %drives) { print "$drive: $drives{$drive}\n"; } __END__ #prints........... A: The device is not ready. C: Volume in drive C is Main-Max D: The device is not ready. E: The device is not ready. F: The device is not ready. G: Volume in drive G is CIS27 H: Volume in drive H is Sata-1a I: Volume in drive I is SATA-1B

In reply to Re: Searching for a music files by Marshall
in thread Searching for a music files by changma_ha

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.