Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HELP - > Adapter MAC Address !????? and Hard Disk ID ?

479 views
Skip to first unread message

Roberto Esteban Sánchez

unread,
Aug 4, 2000, 3:00:00 AM8/4/00
to
Hi. I need hoy i can know the MAC Address in a PC !
 
And a Id of my Hard Disk ?
 
Sorry my engish !   

 


Roberto Esteban
Programador
Centro de Cálculo
rob...@cal.upco.es
www.pagina.de/Roberto_Esteban

Universidad Pontificia Comillas.
http://www.upco.es

Jens Häupel

unread,
Aug 4, 2000, 3:00:00 AM8/4/00
to

Hi Roberto,

I have an answer to one of your questions:

HOWTO: Get Network Adapter Address from Visual Basic [vbwin]
ID: Q175472
http://support.microsoft.com/support/kb/articles/q175/4/72.asp

Hope, this helps
- Jens -


Roberto Esteban Sánchez <rob...@cal.upco.es> schrieb in im Newsbeitrag:
#jG7jJe$$GA.195@cppssbbsa04...

Hi. I need hoy i can know the MAC Address in a PC !

And a Id of my Hard Disk ?

Sorry my engish !


Kevin Napier

unread,
Aug 6, 2000, 3:00:00 AM8/6/00
to
Here's the second anwser.
Use winApi: GetVolumeInformation() to get the Volumeserialnumber... note the volumeserialnumber will change on each format of the drive.
 
BOOL GetVolumeInformation(
  LPCTSTR lpRootPathName,           // root directory
  LPTSTR lpVolumeNameBuffer,        // volume name buffer
  DWORD nVolumeNameSize,            // length of name buffer
  LPDWORD lpVolumeSerialNumber,     // volume serial number
  LPDWORD lpMaximumComponentLength, // maximum file name length
  LPDWORD lpFileSystemFlags,        // file system options
  LPTSTR lpFileSystemNameBuffer,    // file system name buffer
  DWORD nFileSystemNameSize         // length of file system name buffer
);
 
"Roberto Esteban Sánchez" <rob...@cal.upco.es> wrote in message news:#jG7jJe$$GA.195@cppssbbsa04...
Hi. I need hoy i can know the MAC Address in a PC !
 
And a Id of my Hard Disk ?
 
Sorry my engish !   

Mike

unread,
Sep 6, 2000, 2:48:17 PM9/6/00
to
I tried this and it doesn't seem to work on NT... Works fine on 9x though.
Any idea what I'm doing wrong?

--
Mike Reveile
Lightspeed Consulting
Jens Häupel <a...@hotmail.com> wrote in message
news:eP1dwve$$GA.171@cppssbbsa05...


> Hi Roberto,
>
> I have an answer to one of your questions:
>
> HOWTO: Get Network Adapter Address from Visual Basic [vbwin]
> ID: Q175472
> http://support.microsoft.com/support/kb/articles/q175/4/72.asp
>
> Hope, this helps
> - Jens -
>
>
>
>
> Roberto Esteban Sánchez <rob...@cal.upco.es> schrieb in im Newsbeitrag:

> #jG7jJe$$GA.195@cppssbbsa04...
>
> Hi. I need hoy i can know the MAC Address in a PC !
>
> And a Id of my Hard Disk ?
>
> Sorry my engish !
>
>
>
>

Mark Taylor

unread,
Sep 6, 2000, 3:15:17 PM9/6/00
to
Roberto,

Check out this example for the MAC address...

http://www.mvps.org/vbnet/code/network/macaddress.htm
 

---
Hope this helps,
Mark
 
 

Roberto Esteban Sánchez wrote:

Hi. I need hoy i can know the MAC Address in a PC ! And a Id of my Hard Disk ? Sorry my engish ! 

Michel Walsh

unread,
Sep 20, 2000, 3:00:00 AM9/20/00
to
Hi,

There is a nice article in VBPJ (September 2000), by Ken Getz about using
WMI to get that kind of info:

Get the WMI Scripting 1.1 reference in your project.
--------------
Public Function GetMACAddress()
Dim objs As WbemScripting.SWbemObjectSet
Dim obj As WbemScripting.SWbemObject
Set objs = GetObject("winmgmts:").ExecQuery("SELECT MACAddress FROM
Win32_NetworkAdapter WHERE " & _
" (MACAddress IS NOT Null) AND (Manufacturer <>'Microsoft')")

For Each obj In objs: GetMACAddress = obj.MACAddress: Exit For: Next obj
End Function
---------------


There is also other examples. From one of them, it is easy to get the Drive
ID (I assume you meant the number reported from the format):
--------------
Public Function GetVolumeSerialNumber(Drive As String) As String
Dim objs As WbemScripting.SWbemObjectSet
Dim obj As WbemScripting.SWbemObject
Set objs = GetObject("winmgmts:").ExecQuery("SELECT * FROM
Win32_LogicalDisk " & _
" WHERE DriveType=3 AND Name='" & Drive & "'")
For Each obj In objs
GetVolumeSerialNumber = obj.VolumeSerialNumber
Exit For
Next obj
End Function
--------------

Hoping it may help,
Vanderghast, Access MVP


"Mike" <ad...@innersphere.com> wrote in message
news:e5p6oMDGAHA.196@cppssbbsa04...

Michel Walsh

unread,
Sep 21, 2000, 3:00:00 AM9/21/00
to

Hi,


the exact reference is


Microsoft WMI Scripting 1.1


Easier to spot that way.


Vanderghast, Access MVP


"Michel Walsh" <Vande...@msn.com> wrote in message
news:u0zNyf1IAHA.267@cppssbbsa04...

0 new messages