Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.basic.visual.misc > #176

Re: Need help with writing drive property: Possible solution

From "MikeD" <nobody@nowhere.edu>
Newsgroups comp.lang.basic.visual.misc, microsoft.public.vb.general.discussion
Subject Re: Need help with writing drive property: Possible solution
Date 2011-05-22 09:02 -0400
Organization A noiseless patient Spider
Message-ID <irb1ho$7as$1@dont-email.me> (permalink)
References <ir98hg$5dq$1@dont-email.me> <ir9gm7$mgl$1@dont-email.me> <ir9i00$t2k$1@dont-email.me> <ir9vnu$veo$1@dont-email.me> <ira8ut$6u3$1@dont-email.me>

Cross-posted to 2 groups.

Show all headers | View raw



"GS" <gs@somewhere.net> wrote in message news:ira8ut$6u3$1@dont-email.me...
> I've determined that WMI Win32_DiskDrive provides the Index for each 
> drive. Also, I can filter it on InterfaceType "USB".
>
> The Index appears to be the drive's position in the Drives enumerated by 
> "DiskDrive" according to the order the drives were 'plugged in'. This 
> indexing appears to not include "CD-ROM" drives.
>
> I need to test this on several machines but it seems feasible to use FSO 
> to iterate its Drives collection and filter for DriveType "1,2" and put 
> the DriveLetter into an array. Then build the target drives path by 
> getting the drive letter from the array using "DiskDrive.Index".
>
> Does anyone foresee any pitfalls in the solution?


Besides using FSO?  Consider using GetLogicalDrives or 
GetLogicalDriveStrings and GetDriveType Win32 API functions.  You might also 
be able to use DeviceIoControl or some other API function rather than WMI. 
As Mayanana said, WMI is a service and there is always a risk that it's been 
disabled or otherwise not running.

You might want to explain in more detail what you're really doing all this 
for.  So far, you've only said "I was looking for a way to let users choose 
a removeable drive to install an app that requires portable licensing to 
work with the USB device". I have no idea what that means and I'd guess 
nobody else does either. There might very well be an entirely different, and 
better, approach to doing whatever it is.

-- 
Mike
 

Back to comp.lang.basic.visual.misc | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Need help with writing drive property GS <gs@somewhere.net> - 2011-05-21 16:54 -0400
  Re: Need help with writing drive property "Mayayana" <mayayana@invalid.nospam> - 2011-05-21 19:10 -0400
    Re: Need help with writing drive property GS <gs@somewhere.net> - 2011-05-21 19:35 -0400
      Re: Need help with writing drive property "Mayayana" <mayayana@invalid.nospam> - 2011-05-21 23:27 -0400
        Re: Need help with writing drive property GS <gs@somewhere.net> - 2011-05-22 00:49 -0400
          Re: Need help with writing drive property GS <gs@somewhere.net> - 2011-05-22 00:58 -0400
        Re: Need help with writing drive property: Possible solution GS <gs@somewhere.net> - 2011-05-22 02:07 -0400
          Re: Need help with writing drive property: Possible solution "MikeD" <nobody@nowhere.edu> - 2011-05-22 09:02 -0400
            Re: Need help with writing drive property: Possible solution GS <gs@somewhere.net> - 2011-05-22 14:29 -0400
              Re: Need help with writing drive property: Possible solution "MikeD" <nobody@nowhere.edu> - 2011-05-22 17:01 -0400
                Re: Need help with writing drive property: Possible solution GS <gs@somewhere.net> - 2011-05-22 18:28 -0400
                Re: Need help with writing drive property: Possible solution GS <gs@somewhere.net> - 2011-05-22 18:29 -0400
                Re: [OT] Bolding text. Dee Earley <dee.earley@icode.co.uk> - 2011-05-23 10:54 +0100
                Re: [OT] Bolding text. "Jim Mack" <no-uce-ube@mdxi.com> - 2011-05-23 09:33 -0400
                Re: [OT] Bolding text. Helmut_Meukel <Helmut_Meukel@bn-hof.invalid> - 2011-05-23 17:48 +0200
                Re: [OT] Bolding text. Helmut_Meukel <Helmut_Meukel@bn-hof.invalid> - 2011-05-23 18:00 +0200
                Re: [OT] Bolding text. Dee Earley <dee.earley@icode.co.uk> - 2011-05-24 10:44 +0100
                Re: Need help with writing drive property: Possible solution "MikeD" <nobody@nowhere.edu> - 2011-05-23 08:51 -0400
                Re: Need help with writing drive property: Possible solution GS <gs@somewhere.net> - 2011-05-23 10:48 -0400
          Re: Need help with writing drive property: Possible solution "Mayayana" <mayayana@invalid.nospam> - 2011-05-22 09:23 -0400
            Re: Need help with writing drive property: Possible solution GS <gs@somewhere.net> - 2011-05-22 14:36 -0400
            Re: Need help with writing drive property: Possible solution GS <gs@somewhere.net> - 2011-05-22 14:49 -0400
            Re: Need help with writing drive property: Possible solution GS <gs@somewhere.net> - 2011-05-22 16:26 -0400
              Re: Need help with writing drive property: Possible solution "Mayayana" <mayayana@invalid.nospam> - 2011-05-22 18:29 -0400
                Re: Need help with writing drive property: Possible solution GS <gs@somewhere.net> - 2011-05-22 18:33 -0400
              Re: Need help with writing drive property: Possible solution "Mayayana" <mayayana@invalid.nospam> - 2011-05-22 18:36 -0400
                Re: Need help with writing drive property: Possible solution GS <gs@somewhere.net> - 2011-05-22 18:49 -0400
                Re: Need help with writing drive property: Possible solution "Mayayana" <mayayana@invalid.nospam> - 2011-05-22 20:48 -0400
                Re: Need help with writing drive property: Possible solution GS <gs@somewhere.net> - 2011-05-22 21:30 -0400
  Re: Need help with writing drive property "MikeD" <nobody@nowhere.edu> - 2011-05-21 19:42 -0400
    Re: Need help with writing drive property GS <gs@somewhere.net> - 2011-05-21 20:14 -0400
  Re: Need help with writing drive property - Final Approach GS <gs@somewhere.net> - 2011-05-23 13:20 -0400

csiph-web