Jump to content

NexusCommader

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by NexusCommader

  1. further to my previous post, I tuned the win8 logic, removing the weird string replace method. If $isWin8 Then $sKeyOutput = StringMid($sKeyOutput,2,$iLast)&"N"&StringTrimLeft($sKeyOutput,$iLast+1) EndIf tested with windows 8 and server 2012 keys, correct
  2. 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
  3. I know this is an old post but it pointed me in the right direction. so I made this function to compare file sizes, I'm sharing this to help others out. ;===== ;script assumes no more than 3 decimal points ;Created by NexusCommander ;Return: ;-1 = error ;0 = same version number ;1 = 1st version is bigger ;2 = 2nd version is bigger ;===== Func Version_compare($ver1,$ver2) If $ver1 = '' OR $ver2 = '' Then Return -1 $ver1 = StringSplit($ver1,'.') $ver2 = StringSplit($ver2,'.') ReDim $ver1[5] ReDim $ver2[5] For $a1 = 1 To 4 Select Case Number($ver1[$a1]) = Number($ver2[$a1]) ContinueLoop Case Number($ver1[$a1]) > Number($ver2[$a1]) Return 1 Case Number($ver1[$a1]) < Number($ver2[$a1]) Return 2 EndSelect Next Return 0 EndFunc
×
×
  • Create New...