AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

MAC Address

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Tom
Guest





PostPosted: Mon Nov 30, 2009 9:56 pm    Post subject: MAC Address Reply with quote

Hi
I've searched the forum and found a few ways to find the MAC Address of a LAN card, but they all involve ipconfig /all > file.txt then searching the file.

Is it possible to do this, but send the results to a array(variable) and then filter/search that ?? so no file is written and the work is done in memory ?

Thanks in advance.
Back to top
txquestor



Joined: 22 Aug 2009
Posts: 294

PostPosted: Mon Nov 30, 2009 11:58 pm    Post subject: Reply with quote

You can write to memory
http://www.autohotkey.com/forum/viewtopic.php?t=16823
http://www.autohotkey.com/forum/topic12251.html
_________________

"Man's quest for knowledge is an expanding series whose limit is infinity"
Back to top
View user's profile Send private message
TLM



Joined: 21 Aug 2006
Posts: 2926
Location: The Shell

PostPosted: Tue Dec 01, 2009 4:33 am    Post subject: Reply with quote

Another method.

Still writes a file but deletes it so fast you'd never know it was ever written.

Code:
RunWait, %comspec% /c ""ipconfig" "/all" >"%A_Desktop%\macInfo.txt"",,Hide
    FileRead, fileInfo, % A_Desktop "\macInfo.txt"
    Loop, Parse,fileInfo, `n, `r
   {
   if A_LoopField contains Physical Address
       {
       StringTrimLeft, macAdd, A_LoopField, 44
       FileDelete, % A_Desktop "\macInfo.txt"
       Break
       }
   }
Msgbox, % "MAC ADDRESS: " macAdd



hth
_________________
paradigm.shift:=(•_•)┌П┐RTFM||^.*∞
Back to top
View user's profile Send private message
jaco0646



Joined: 07 Oct 2006
Posts: 3113
Location: MN, USA

PostPosted: Tue Dec 01, 2009 4:24 pm    Post subject: Reply with quote

Tip: retrieving command line output without a text file
Back to top
View user's profile Send private message Visit poster's website
Tom
Guest





PostPosted: Tue Dec 01, 2009 8:42 pm    Post subject: Reply with quote

Thanks for the replies.

got this working using TLM's example, would prefer for this to be done in memory, I don't understand how to do it !

If anyone can help I would appreciate it.
Thank you.
Back to top
TLM



Joined: 21 Aug 2006
Posts: 2926
Location: The Shell

PostPosted: Wed Dec 02, 2009 1:03 am    Post subject: Reply with quote

Did you see the example jaco0646 linked to? It basically runs bat commands, stores and 'calls' the value to (now dont quote me) the environment variable %0

I'm still trying to figure out how to store the value to the current script instance.

Its not obvious but way easier than the functions method (plus no external lib needed Wink).



Will report back if I figure it out.
_________________
paradigm.shift:=(•_•)┌П┐RTFM||^.*∞
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group