AutoHotkey Community

It is currently May 27th, 2012, 12:19 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: MAC Address
PostPosted: November 30th, 2009, 10:56 pm 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 1st, 2009, 12:58 am 
Offline

Joined: August 22nd, 2009, 11:23 pm
Posts: 294
You can write to memory
http://www.autohotkey.com/forum/viewtopic.php?t=16823
http://www.autohotkey.com/forum/topic12251.html

_________________
Image
"Man's quest for knowledge is an expanding series whose limit is infinity"


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 1st, 2009, 5:33 am 
Offline

Joined: August 21st, 2006, 7:07 pm
Posts: 2925
Location: The Shell
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

_________________
Imageparadigm.shift:=(•_•)┌П┐RTFM||^.*∞


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 1st, 2009, 5:24 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
Tip: retrieving command line output without a text file


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 1st, 2009, 9:42 pm 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 2nd, 2009, 2:03 am 
Offline

Joined: August 21st, 2006, 7:07 pm
Posts: 2925
Location: The Shell
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 ;)).



Will report back if I figure it out.

_________________
Imageparadigm.shift:=(•_•)┌П┐RTFM||^.*∞


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Leef_me, Pulover, rjgatito, XstatyK and 21 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group