Matthew Hipkin

Quick and dirty way to detect Windows 10 using FreePascal

Here is a quick and dirty way to detect Windows 10 using FreePascal.

function IsWin10: Boolean;
var
  output: String;
begin
  output := '';
  Result := false;
  if RunCommand('cmd.exe',['/C','ver'],output) then
  begin
    if AnsiPos('[Version 10',output) > 0 then Result := true;
  end;
end;

This function requires the Process unit to be present in your uses clause.

Posted in freepascal on 2017-04-16 19:14:28

blog comments powered by Disqus