Flutter Process.run() with runInShell: true runs the command in shell but when compiled to exe opens a new window

1.3k Views Asked by At

I have a function that uses the Windows ping command:

ProcessResult process = await Process.run(
  'ping',
  ['-n', '1', '-l', '1', '-w', '100', host.name],
  runInShell: true,
);

When I run it in Visual Studio Code it works normally. But When I compile it to Windows executable and it runs my function, it opens a new window of my app instead of opening cmd in the background and executing the ping command in it.

Is there a reason and possibly a solution why it does that?

0

There are 0 best solutions below