Jump to content

Recommended Posts

Posted

Hello everyone,

1st i wanna excuse if this code is published somewhere... i took it from rainmeter forums and edited it a little bit, but now im facing a problem

Everything works fine... the thing i need is once i receive the MAC address to be with ":" between numbers or even "" instead "-" like atm

2nd sorry for my bad English

 

Here is the code:

#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseUpx=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include <Constants.au3>
#include <Array.au3>

Local $Out

if $CmdLine[0] = 3 Then

    $ConfigPath = $CmdLine[1]
    $ProgramPath = $CmdLine[2] & "Rainmeter.exe"

    $Cmd = Run(@ComSpec & " /c " & 'getmac /fo list', "", @SW_HIDE, $STDOUT_CHILD)

    While 1
        $Out = $Out & StdoutRead($Cmd)
        If @error Then ExitLoop
    Wend

    $RegExp = "(?siU).*: (.*)\r\n"

    $MACAddress = StringRegExp($Out, $RegExp, 3)

    if IsArray($MACAddress) Then
        ShellExecute($ProgramPath, "!RainmeterSetVariable zMACAddressTEST " & $MACAddress[0])
    Else
        ShellExecute($ProgramPath, "!RainmeterSetVariable zMACAddressTES Unknown")
    EndIf

EndIf

Exit

 

Posted

It would be nice if you'd share your solution with others, you'll never know if you have the same problem again :)

After switching years ago to Linux, sadly I don't use AutoIt anymore.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...