Hello, I'm trying to lock a script to a mac address (just trying as a small project of mine), and I've sort of hit a roadblock.
The code I have now is this:
Code: Select all
GetMacAddress(){
tempfile = %A_Temp%\mac.txt
RunWait, %ComSpec% /c getmac /NH > %tempfile%, , Hide ; ipconfig (slow)
FileRead, mac, %tempfile%
MsgBox, %mac%
}
GetMacAddress()
Password = "<Mac address>"
MsgBox, %Password%
If (InStr(mac, Password) > 0){
MsgBox, found
}
Else {
ExitApp
}
However, this code always returns false and exits the app. I've tried a number of different codes that should effectively be the same, such as directly placing the mac address as a literal string within InStr(), flipping the needle and haystack around (not sure why, but this always results in a positive, whether I enclosed each in % or not), and basically every thing I could think of that may have been preventing it from working. Any help is appreciated!