473,663 Members | 2,726 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Detecting IDE Devices in Visual Basic Help

hi,

i am trying to make a very simple program that will just detect
and output your currently connected IDE devices. It will look
something like this:

IDE PRIMARY MASTER:
IDE PRIMARY SLAVE:

IDE SECONDARY MASTER:
IDE SECONDARY SLAVE:

And it will just show you what you have connected.
I have been researching for hours and hours for how to
do this and I've come up with NOTHING!

Is this even possible?

I know what you're going to say, why do that when you
can just see the same information in your BIOS when
your computer boots up. I know I can do that, but
I want a way to do it in windows.

Any and all help you can give me (no matter how small), even
a push in the right direction will be appreciated.

Thanks for your help.

-jasper
Jul 17 '05 #1
1 2954
"jasper" <sd**********@a s9df7as9df7.com > wrote

i am trying to make a very simple program that will just detect
and output your currently connected IDE devices. It will look
something like this:

IDE PRIMARY MASTER:
IDE PRIMARY SLAVE:

IDE SECONDARY MASTER:
IDE SECONDARY SLAVE:

And it will just show you what you have connected.
I have been researching for hours and hours for how to
do this and I've come up with NOTHING!

Is this even possible?

This should get you started. It may have more than you wanted
to know about your drives, but it was basically a copy and paste
from a scripting resource. Take note of the ExecQuery, as it is
'similar' to SQL (a _small_ subset, to say the least) so that you can
tailor the query to return just the properties you want, or include
a WHERE clause to return just those whose InterfaceType is IDE,
etc....

Paste the code below into a Form, add a button and remove
Option Explicit, if present. (Not advised, but for the demo....)
For further studies, locate tutorials on WMI scripting.

LFS

Private Sub Command1_Click( )

strComputer = "."
Set objWMIService = GetObject("winm gmts:" _
& "{impersonation Level=impersona te}!\\" & strComputer & "\root\cimv 2")

Set colDiskDrives = objWMIService.E xecQuery _
("SELECT * FROM Win32_DiskDrive ")

For Each objDiskDrive In colDiskDrives
Debug.Print vbCrLf

' Might these be what you want?
Debug.Print "Caption: " & objDiskDrive.Ca ption
Debug.Print "Interface Type: " & objDiskDrive.In terfaceType
Debug.Print "Device ID: " & objDiskDrive.De viceID

Debug.Print "Bytes Per Sector: " & _
objDiskDrive.By tesPerSector
For Each strCapability In objDiskDrive.Ca pabilities
Debug.Print "Capabiliti es: " & strCapability
Next
Debug.Print "Index: " & objDiskDrive.In dex
Debug.Print "Manufactur er: " & objDiskDrive.Ma nufacturer
Debug.Print "Media Loaded: " & objDiskDrive.Me diaLoaded
Debug.Print "Media Type: " & objDiskDrive.Me diaType
Debug.Print "Model: " & objDiskDrive.Mo del
Debug.Print "Name: " & objDiskDrive.Na me
Debug.Print "Partitions : " & objDiskDrive.Pa rtitions
Debug.Print "PNP DeviceID: " & objDiskDrive.PN PDeviceID
Debug.Print "SCSI Bus: " & objDiskDrive.SC SIBus
Debug.Print "SCSI Logical Unit: " & _
objDiskDrive.SC SILogicalUnit
Debug.Print "SCSI Port: " & objDiskDrive.SC SIPort
Debug.Print "SCSI TargetId: " & objDiskDrive.SC SITargetId
Debug.Print "Sectors Per Track: " & _
objDiskDrive.Se ctorsPerTrack
Debug.Print "Size: " & objDiskDrive.Si ze
Debug.Print "Status: " & objDiskDrive.St atus
Debug.Print "Total Cylinders: " & _
objDiskDrive.To talCylinders
Debug.Print "Total Heads: " & objDiskDrive.To talHeads
Debug.Print "Total Sectors: " & objDiskDrive.To talSectors
Debug.Print "Total Tracks: " & objDiskDrive.To talTracks
Debug.Print "Tracks Per Cylinder: " & _
objDiskDrive.Tr acksPerCylinder
Next

End Sub



-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 17 '05 #2

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

Similar topics

0
2861
by: jasper | last post by:
hi, i am trying to make a very simple program that will just detect and output your currently connected IDE devices. It will look something like this: IDE PRIMARY MASTER: IDE PRIMARY SLAVE: IDE SECONDARY MASTER:
1
1593
by: jasper | last post by:
hi, i am trying to make a very simple program that will just detect and output your currently connected IDE devices. It will look something like this: IDE PRIMARY MASTER: IDE PRIMARY SLAVE: IDE SECONDARY MASTER:
3
2849
by: Casey Entzi | last post by:
I have Visual C#.net and got visual studio 2003 with it as a package. My question is, can I create programs for Smart Devices? In the help file it walks you through it, but it tells you to create a new project and click smart device. The only templates it lists under "Visual C# Projects are: Windows Application Class Library ASP.NET Web Application ASP.NET Web Service ASP.NET Mobile Web Application
4
15192
by: Bradley Grant | last post by:
Does anyone out there know of where I could find some C# example programs for accessing USB Devices. There just does not seem to be much out there on this subject. Even after doing a Google, Yahoo, Lycos search engines. Any feed back would be appreciate. Bradley
0
1205
by: Yanick Masse | last post by:
I'm writing an MFC ActiveX control and some C function expose in a DLL that will be used in Visual Basic .NET and Visual C#. I want to detect in my code if we are currently beeing debugged by any debugger (Managed and Unmanaged debugger.). Previously, we were using the win32 IsDebuggerPresent() method. This method always returns false when we are beeing debugged in a Visual Basic .NET application without "Unmanaged code debugging"...
6
1863
by: scorpion53061 | last post by:
I understand my version of VS can support hand held software development (e.g. Palm Pilot) I would like to look into developing some of the desktop stuff I wrote into a palm version. Does anyone have a tutorial I can look into?
3
10685
by: steve | last post by:
Hi All I need to write a program to read input from barcode scanner. The program is for a gym and needs to detect when a card is scanned regardless of which program is currently running ont he computer. e.g the operator might be typing a letter and a member swipes his card. I am convinced I need to write the card reader section as a Windows Service, so it is active always?
3
3607
by: regtrashcan | last post by:
I have a webpage that detects whether Shockwave Player is installed and the version number. The javascript/vbscript that I use has worked fine until the latest release of the Shockwave Player. I am still able to detect the Shockwave Player and the version number when using Firefox/Netscape, but not with IE. I have my own detection script that I use, but I've also used the detection scripts supplied from Macromedia, but it still won't...
10
10772
by: Immortalist | last post by:
Various aquisition devices that guide learning along particular pathways towards human biases. And as E.O. Wilson might say mental development appears to be genetically constrained. (1) Language Aquisition Device (2) Color Aqusition Device (3) Sound Aquistion Device (4) Smell Aquisition Device (5) Touch Aquisition Device (6) Art Aquisition Device
0
8436
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8858
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8771
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8548
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8634
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7371
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6186
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5657
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2000
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.