Can you try this? I wrote this sub:

#################################################################### # # This function returns a list of logical drives in Windows. # Each list element starts with drive letter, followed by # drive type, serial number, file system, label, total space # and free space. All items will be separated by a '*' character. # # If one or more letters are provided as an argument, # then data will be returned only about those drives. # Example: # GetDriveInfo('CE') => Returns data about drive C: and E: # If drive E: does not exist, then it will be left # out of the list! # # Usage: STRING = GetDriveInfo([DRIVEs]) # sub GetDriveInfo { my $DRIVES = defined $_[0] ? $_[0] : 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; return RunJS("V='$DRIVES';try{FSO=new ActiveXObject('Scripting.FileS +ystemObject');}catch(e){WScript.Quit(0);}A=[];function ToHex(N){N|=0; +var i,X='';for(i=0;i<32;i+=4)X='0123456789ABCDEF'.charAt((N>>i)&15)+X +;return X;}for(i=0;i<V.length;i++){L=V.charAt(i)+':';if(FSO.DriveExis +ts(L)){D=FSO.GetDrive(L);if(D.IsReady){S=ToHex(D.SerialNumber)+'*'+D. +FileSystem+'*'+D.VolumeName+'*'+D.TotalSize+'*'+D.FreeSpace;}A.push(L ++'*'+D.DriveType+'*'+S);}}WScript.StdOut.WriteLine(A.join(\"\\r\\n\") +);"); } # # Usage: INTEGER = RunJS(JSCODE) # sub RunJS { no warnings; $^O =~ m/MSWIN/i && defined $_[0] && length($_[0]) or return 0; mkdir "C:\\TEMP"; my $TEMPFILE = "C:\\TEMP\\JSTMP001.JS"; my $CSCRIPT = "C:\\WINDOWS\\SYSTEM32\\CSCRIPT.EXE"; -f $CSCRIPT or return 0; local *FILE; open(FILE, ">$TEMPFILE") or return 0; binmode FILE; print FILE $_[0]; close FILE; -f $TEMPFILE && -s $TEMPFILE == length($_[0]) or return 0; my $E = system("$CSCRIPT //NOLOGO $TEMPFILE"); unlink $TEMPFILE; return $E + 1; }

In reply to Re: Almost cool: removable drive "finder" instead of windows autoplay by harangzsolt33
in thread Almost cool: removable drive "finder" instead of windows autoplay by Intrepid

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.