Public Sub CheckWin11 As ResumableSub
Try
Dim shl As Shell
shl.Initialize("shl", "cmd", Array As String("/C", "ver"))
shl.Run(3000) 'set a timeout of 3 seconds
Wait For (shl) shl_ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
If Success And ExitCode = 0 Then
'Log(StdOut) ' Microsoft Windows [Version 10.0.22000.652]
Dim out As String = StdOut.Trim
If out.Contains("Microsoft Windows") And out.Contains("10.0.") Then
out = out.SubString2(out.IndexOf("10.0.") + 5, out.Length - 1)
Dim version As Double = out
Return version >= 22000.493
End If
Else
Log("Error: " & StdErr)
End If
Catch
Log(LastException)
End Try
Return False
End Sub