Click here to Skip to main content
13,298,088 members (73,865 online)
Rate this:
Please Sign up or sign in to vote.
See more:
How to find MAC address of client computer
Posted 15-Feb-13 22:29pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Is it assignment of the day? I did replied the exact same question few hours back. You guys don't look before posting!:doh:
how to get the mac address of my pc in php[^]
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

It depends on security level page runs on. If you are running script using some elevated privileges, on a windows machine, one of code snippets below below could work

for (var arr = [], enum_ = new Enumerator(GetObject('WinMgmts:\\\\.\\Root\\CIMV2').ExecQuery('SELECT * FROM Win32_NetworkAdapter', 'WQL', 0x10 | 0x20)); !enum_.atEnd(); enum_.moveNext()) {
    var mac = enum_.item().MACAddress;
    mac && arr.push(mac);

var arr = [], WScriptExec = WScript.CreateObject('WScript.Shell').Exec('ipconfig /all');
while (!WScriptExec.status) WScript.Sleep(100);

From the web page, unless you use some undocumented feature or specific component, it would not be possible to get the MAC address.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.171207.1 | Last Updated 16 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100