My windows 8 product key has the "N" as the first chr of the key so the key would return "N"
string replace must work different from VB to autoit
I found the bug and fixed
If $isWin8 Then
Local Const $sKeyPart1 = StringMid($sKeyOutput, 2, $iLast)
Local Const $sInsert = "N"
If Not $iLast Then
$sKeyOutput = $sInsert & StringTrimLeft($sKeyOutput, 1)
Else
$sKeyOutput = StringReplace(StringTrimLeft($sKeyOutput, 1), $sKeyPart1, $sKeyPart1 & $sInsert, 1)
EndIf
EndIf
if N is first then $iLast = 0 then $sKeyPart1 = ""
StringReplace() using "" as search causes it to replace the whole key, end result was returning "N"
after my modification key is correct