473,406 Members | 2,273 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

VB.NET - Detecting the attachment of removable storage?

Max
Not sure exactly how to describe this or if it's even possible, so I'll
do my best and would appreciate some suggestions.

I'm currently working on a service that will allow me to automate some
file and folder manipulations. While this question is not concerning the
primary purpose of the program, I think it would be a nice addition.
What I'd like to be able to do is have the service be able to "detect"
whenever the user attaches some mass storage device (flash drive, usb
hard drives, mp3 players that don't need any soft, some media in card
readers like CF or SD, etc.) and be able to identify it, like by a
serial number or something. Would this be possible through some API
maybe? It's only for Win2k, XP, and 2k3, and all of those all do these
operations very easily and quickly, just a little pop-up from sys tray
to let you know that the device has been identified. How could I monitor
those events, find some information about the device that would separate
it from all others, and then get the drive letter that windows gave it?

Might be a rather complex problem, but like I've said, don't know much
about or how to even begin. If you have any ideas, please let me know.
Thanks.
Nov 20 '05 #1
3 5689
Hi,

Create a windows hook to look for the WM_DEVICECHANGE message.
http://msdn.microsoft.com/msdnmag/is...0/CuttingEdge/
http://www.dotnet247.com/247referenc...43/217435.aspx

Ken
--------------------
"Max" <ma*****@yahoo.com> wrote in message
news:OY********************@comcast.com...
Not sure exactly how to describe this or if it's even possible, so I'll do
my best and would appreciate some suggestions.

I'm currently working on a service that will allow me to automate some
file and folder manipulations. While this question is not concerning the
primary purpose of the program, I think it would be a nice addition. What
I'd like to be able to do is have the service be able to "detect" whenever
the user attaches some mass storage device (flash drive, usb hard drives,
mp3 players that don't need any soft, some media in card readers like CF
or SD, etc.) and be able to identify it, like by a serial number or
something. Would this be possible through some API maybe? It's only for
Win2k, XP, and 2k3, and all of those all do these operations very easily
and quickly, just a little pop-up from sys tray to let you know that the
device has been identified. How could I monitor those events, find some
information about the device that would separate it from all others, and
then get the drive letter that windows gave it?

Might be a rather complex problem, but like I've said, don't know much
about or how to even begin. If you have any ideas, please let me know.
Thanks.

Nov 20 '05 #2
Hi Max,

I do not know how far it is possible, however I think you would have a look
first to this management class before you start with API's

http://msdn.microsoft.com/library/de...management.asp

I hope this helps?

Cor
Nov 20 '05 #3
Max
Would you by any chance have some VB code examples? I did a little bit
of looking around, but most of what I found was in C++ and still nothing
that gets me any closer.

Ken Tucker [MVP] wrote:
Hi,

Create a windows hook to look for the WM_DEVICECHANGE message.
http://msdn.microsoft.com/msdnmag/is...0/CuttingEdge/
http://www.dotnet247.com/247referenc...43/217435.aspx

Ken
--------------------
"Max" <ma*****@yahoo.com> wrote in message
news:OY********************@comcast.com...

Not sure exactly how to describe this or if it's even possible, so I'll do
my best and would appreciate some suggestions.

I'm currently working on a service that will allow me to automate some
file and folder manipulations. While this question is not concerning the
primary purpose of the program, I think it would be a nice addition. What
I'd like to be able to do is have the service be able to "detect" whenever
the user attaches some mass storage device (flash drive, usb hard drives,
mp3 players that don't need any soft, some media in card readers like CF
or SD, etc.) and be able to identify it, like by a serial number or
something. Would this be possible through some API maybe? It's only for
Win2k, XP, and 2k3, and all of those all do these operations very easily
and quickly, just a little pop-up from sys tray to let you know that the
device has been identified. How could I monitor those events, find some
information about the device that would separate it from all others, and
then get the drive letter that windows gave it?

Might be a rather complex problem, but like I've said, don't know much
about or how to even begin. If you have any ideas, please let me know.
Thanks.


Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Garet Cammer | last post by:
Hi Everyone, I am writing a program to perform backup operations using the VB scripting File System Object to copy to removable media storage devices. The backup operation works fine, but when we...
1
by: Cliff Liao | last post by:
Hi all, I am trying to install the .NET framework 1.1 runtime package on Windows 2000 SP4. While the installation starts well, I get the following message box during the installation process :...
6
by: Rob | last post by:
int *p; p = malloc(1); free(p); /* */ In the above code, how do I detect that variable p points to nothing?
0
by: Ryan | last post by:
I'm writing a utility that needs to be aware of media (CD, DVD, Zip disk, usb stick, etc) insertions and removals. Which seems to be more of a problem than I original imagined. I can't use any...
1
by: vishal | last post by:
I have a removable device attached to the pc. I want some code to detect that particular device. Can I achieve this thru vb.net? If yes just help me regarding this.. Regards vishal.
3
by: Mike Joyce | last post by:
I am trying to write a portable script that will find removable media, such as compact flash, sd card, usb, etc. drive and then upload files from the media. I want this to be portable so that I can...
7
by: glenn | last post by:
Hi can anyone tell me how given a directory or file path, I can pythonically tell if that item is on 'removable media', or sometype of vfs, the label of the media (or volume) and perhaps any...
4
by: yellowblueyellow | last post by:
Hey All, I am using the following line of code to pick all logical drives on the local machine: string drives = Directory.GetLogicalDrives(); using the above code I can get output in the...
4
by: Per Juul Larsen | last post by:
Hi my VB program must always start from a removable disk. In addition, on the removable media to be images of the type *. jpg *. tips. If not the two conditions are present, the programme will end...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.