|
-
Apr 5th, 2007, 01:11 PM
#1
Thread Starter
Junior Member
Getting MAC using IP
Hi
How can get MAC address by using Local IP Address ?
-
Apr 10th, 2007, 11:22 AM
#2
Fanatic Member
Alpha Micro: Alpha Basic, AS400 V5r2, EDI (Trusted Link/ Inovis.com),Access AS/400 via VB6, Qbasic for data conversions. A mix of Hardware too. ASCII Table , New Number to Words/66 digits , AS/400(v5r2) VB6 Viewer/Ask for code(ODBC) ^ What Is Transferring? , Check your Ports #Perfect Passwords , *Slide Bar Example , Logoff, Restart, Shut-Down PC *Keep Form On Top , Opaque Form ^ Create Objects at Run Time @ Check Key Caps Locks # GetTickCount(System Up Time) * Convert text to Excel & Collected Icons + Resize: Form/Text box ^ PC GateWay via Shell $ Drag & Drop Game ! PopUpMenu *Print File/no Open# Timer on Mult Forms ~ Splash & Mult Forms & Lots of Comments + Random/Timer/Guess * Dec >Hex >Oct >Bin % Get MAC (NIC) < saving to Registry > Wookiee Cookies \ BackUpDisk / World Conection SpeedTest $ Glossary Commonly Used Terms # phonetic list @ Detailed Computer Scan
When posting Code, Use tags.. [CODE] *Your Code* [/CODE]
-
Apr 11th, 2007, 12:06 PM
#3
New Member
Re: Getting MAC using IP
 Originally Posted by sunil_skc
Hi
How can get MAC address by using Local IP Address ?
Hey,
Got some code snipet for you. It's not complete and it may be a bit confusing at first, but just save it as a .vbs file and run it. You'll have to enter in the IP address or Hostname of the system twice (for verification purposes), but it spits out the MAC of all available devices in your box. See code below.
Code:
On Error Resume Next
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
dim strComputers
dim arrComputers
strComputer = inputbox("Enter Computer Identifier Here")
arrComputers = inputbox("Verify Computer Identifier Here")
For Each strComputers In arrComputers
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter", "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem In colItems
WScript.Echo "Computer: " & strComputer & " /DeviceID: " & objItem.DeviceID & " /MACAddress: " & objItem.MACAddress & " /Manufacturer: " & objItem.Manufacturer
Next
Next
It's not completely finished, I'm waiting on an answer back from one of the other forums. It'll do the job, but I want it to parse the info out to a text file and suppress the popup windows.
Good Luck.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|