[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.vb.general.discussion

how to access USB device without drive letter

Heinrich Pfeifer

4/9/2012 4:29:00 PM

Hi,

my VB6 program has to open some files on a USB mass storage device, no
problem so far. To find the correct drive letter, it just scans D: thru
Z: for the property "removable" and for the files wanted.

Now a new generation of USB devices comes to use, and those don't show
up with any drive letter at all. Within Windows Explorer, they appear
with their name instead of drive letter, with a folder below the name
called "internal storage" - looking like kind of portable media player.

How can I open a file on those devices from within VB6?

I got a hint to open Windows Hardware manager and locate the driver and
switch it over to something like "mass storage". Now it has its drive
letter, but I cannot force my customers to do the same.


--

Heinrich
mail: new<at>gartrip.de
21 Answers

GS

4/9/2012 4:49:00 PM

0

Heinrich Pfeifer used his keyboard to write :
> Hi,
>
> my VB6 program has to open some files on a USB mass storage device, no
> problem so far. To find the correct drive letter, it just scans D: thru Z:
> for the property "removable" and for the files wanted.
>
> Now a new generation of USB devices comes to use, and those don't show up
> with any drive letter at all. Within Windows Explorer, they appear with their
> name instead of drive letter, with a folder below the name called "internal
> storage" - looking like kind of portable media player.
>
> How can I open a file on those devices from within VB6?
>
> I got a hint to open Windows Hardware manager and locate the driver and
> switch it over to something like "mass storage". Now it has its drive letter,
> but I cannot force my customers to do the same.

I've been using WMI to query/test USB drives with success. Can you
elaborate more on the problem device[s] as to make/model and where I
can acquire one for testing?

--
Garry

Free usenet access at http://www.eternal-sep...
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


Karl E. Peterson

4/9/2012 10:41:00 PM

0

Heinrich Pfeifer laid this down on his screen :
> Now a new generation of USB devices comes to use, and those don't show up
> with any drive letter at all. Within Windows Explorer, they appear with their
> name instead of drive letter, with a folder below the name called "internal
> storage" - looking like kind of portable media player.
>
> How can I open a file on those devices from within VB6?

I'm with Garry, and would be interested in more specifics on the type
of devices that do this. First I've heard of it.

So, you can navigate to the folders in Explorer, right? What's that
say if you click in the Address bar?

--
..NET: It's About Trust!
http://vfre...


Bob Butler

4/9/2012 10:59:00 PM

0


"Karl E. Peterson" <karl@exmvps.org> wrote in message
news:jlvoi7$odl$1@dont-email.me...
> Heinrich Pfeifer laid this down on his screen :
>> Now a new generation of USB devices comes to use, and those don't show up
>> with any drive letter at all. Within Windows Explorer, they appear with
>> their name instead of drive letter, with a folder below the name called
>> "internal storage" - looking like kind of portable media player.
>>
>> How can I open a file on those devices from within VB6?
>
> I'm with Garry, and would be interested in more specifics on the type of
> devices that do this. First I've heard of it.
>
> So, you can navigate to the folders in Explorer, right? What's that say
> if you click in the Address bar?
>

Sounds like it might be using mount points
http://technet.microsoft.com/librar...


Karl E. Peterson

4/9/2012 11:28:00 PM

0

Bob Butler wrote :
> "Karl E. Peterson" <karl@exmvps.org> wrote in message
> news:jlvoi7$odl$1@dont-email.me...
>> Heinrich Pfeifer laid this down on his screen :
>>> Now a new generation of USB devices comes to use, and those don't show up
>>> with any drive letter at all. Within Windows Explorer, they appear with
>>> their name instead of drive letter, with a folder below the name called
>>> "internal storage" - looking like kind of portable media player.
>>>
>>> How can I open a file on those devices from within VB6?
>>
>> I'm with Garry, and would be interested in more specifics on the type of
>> devices that do this. First I've heard of it.
>>
>> So, you can navigate to the folders in Explorer, right? What's that say if
>> you click in the Address bar?
>>
>
> Sounds like it might be using mount points
> http://technet.microsoft.com/librar...

I couldn't get that page to load here, but that'd provide a file system
path to its folders and files, right? Just under My Documents, or
something, rather than its own drive letter?

--
..NET: It's About Trust!
http://vfre...


Bob Butler

4/9/2012 11:47:00 PM

0


"Karl E. Peterson" <karl@exmvps.org> wrote in message
news:jlvrau$b9l$1@dont-email.me...
> Bob Butler wrote :
>> "Karl E. Peterson" <karl@exmvps.org> wrote in message
>> news:jlvoi7$odl$1@dont-email.me...
>>> Heinrich Pfeifer laid this down on his screen :
>>>> Now a new generation of USB devices comes to use, and those don't show
>>>> up with any drive letter at all. Within Windows Explorer, they appear
>>>> with their name instead of drive letter, with a folder below the name
>>>> called "internal storage" - looking like kind of portable media player.
>>>>
>>>> How can I open a file on those devices from within VB6?
>>>
>>> I'm with Garry, and would be interested in more specifics on the type of
>>> devices that do this. First I've heard of it.
>>>
>>> So, you can navigate to the folders in Explorer, right? What's that say
>>> if you click in the Address bar?
>>>
>>
>> Sounds like it might be using mount points
>> http://technet.microsoft.com/librar...
>
> I couldn't get that page to load here, but that'd provide a file system
> path to its folders and files, right? Just under My Documents, or
> something, rather than its own drive letter?

Right; you provide a path to an empty NTFS directory and it links it to the
volume.

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/dm_modify_access_path.msp...

GS

4/10/2012 2:41:00 AM

0

Bob Butler expressed precisely :
> "Karl E. Peterson" <karl@exmvps.org> wrote in message
> news:jlvrau$b9l$1@dont-email.me...
>> Bob Butler wrote :
>>> "Karl E. Peterson" <karl@exmvps.org> wrote in message
>>> news:jlvoi7$odl$1@dont-email.me...
>>>> Heinrich Pfeifer laid this down on his screen :
>>>>> Now a new generation of USB devices comes to use, and those don't show
>>>>> up with any drive letter at all. Within Windows Explorer, they appear
>>>>> with their name instead of drive letter, with a folder below the name
>>>>> called "internal storage" - looking like kind of portable media player.
>>>>>
>>>>> How can I open a file on those devices from within VB6?
>>>>
>>>> I'm with Garry, and would be interested in more specifics on the type of
>>>> devices that do this. First I've heard of it.
>>>>
>>>> So, you can navigate to the folders in Explorer, right? What's that say
>>>> if you click in the Address bar?
>>>>
>>>
>>> Sounds like it might be using mount points
>>> http://technet.microsoft.com/librar...
>>
>> I couldn't get that page to load here, but that'd provide a file system
>> path to its folders and files, right? Just under My Documents, or
>> something, rather than its own drive letter?
>
> Right; you provide a path to an empty NTFS directory and it links it to the
> volume.
>
> http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/dm_modify_access_path.msp...

Regardless of how the device is 'mapped', does it still meet USB
PNPDevice standards? And if it does it should still show as
'Removeable' type drive in a WMI query (I would think)!

--
Garry

Free usenet access at http://www.eternal-sep...
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


Bob Butler

4/10/2012 2:47:00 AM

0

"GS" <gs@somewhere.net> wrote in message news:jm06k9$unh$1@dont-email.me...
<cut>
> Regardless of how the device is 'mapped', does it still meet USB PNPDevice
> standards? And if it does it should still show as 'Removeable' type drive
> in a WMI query (I would think)!

There are WMI queries for mount points and logical volumes so maybe it can
be detected. I've never seen a mount point to a USB, I was just suggesting
it as a possibility for how it might be done.

Bob Butler

4/10/2012 3:01:00 AM

0


"Bob Butler" <bob_butler@cox.invalid> wrote in message
news:jm072i$t6$1@dont-email.me...
> "GS" <gs@somewhere.net> wrote in message
> news:jm06k9$unh$1@dont-email.me...
> <cut>
>> Regardless of how the device is 'mapped', does it still meet USB
>> PNPDevice standards? And if it does it should still show as 'Removeable'
>> type drive in a WMI query (I would think)!
>
> There are WMI queries for mount points and logical volumes so maybe it can
> be detected. I've never seen a mount point to a USB, I was just
> suggesting it as a possibility for how it might be done.
>

I just tried it and querying win32_volume returned an entry for the USB
volume with the Name property being the mount point and DriveType of 2
(removable).

The win32_logicaldisk class does not see it. win32_mountpoint can be used
to see if any exist.

GS

4/10/2012 3:02:00 AM

0

It happens that Bob Butler formulated :
> "GS" <gs@somewhere.net> wrote in message news:jm06k9$unh$1@dont-email.me...
> <cut>
>> Regardless of how the device is 'mapped', does it still meet USB PNPDevice
>> standards? And if it does it should still show as 'Removeable' type drive
>> in a WMI query (I would think)!
>
> There are WMI queries for mount points and logical volumes so maybe it can be
> detected. I've never seen a mount point to a USB, I was just suggesting it
> as a possibility for how it might be done.

Got it. I'll look at that in more detail but I'd like to know how it
happens when the default behavior for plugging in a USB storage device
is to assign it a drive letter. Usually, a folder is how mapping is
done and so I'm curious when/why/how this might occur.

--
Garry

Free usenet access at http://www.eternal-sep...
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


Bob Butler

4/10/2012 3:06:00 AM

0

"GS" <gs@somewhere.net> wrote in message news:jm07q9$4cd$1@dont-email.me...
<cut>
> Got it. I'll look at that in more detail but I'd like to know how it
> happens when the default behavior for plugging in a USB storage device is
> to assign it a drive letter. Usually, a folder is how mapping is done and
> so I'm curious when/why/how this might occur.

To test it on my Vista box I inserted the USB and then used disk manager to
remove the drive letter and then add the volume back to a path.

When I finished I stopped and removed the USB stick. The path I had mounted
it to became flagged as invalid. When I re-inserted the USB it remounted
itself to the path instead of as a drive letter.

I'm not saying this is what the OP has going on but it seems to act as
described.