1

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?

  • have you tried `runInShell=false`? What happens? The behaviour your are seeing is what is mentioned in the documentation. – Ber Dec 13 '22 at 19:42
  • I looked more into it and it looks like when I run the app in Visual Studio Code it works fine because VS Code runs it through a command line unlike just opening the executable. It works as intended when I run the executable through a cmd. I tried `runInShell=false` and it has the same result. Now, is there a way I can just run the executable without a cmd? – DavidCZ2051 Dec 13 '22 at 20:54

0 Answers0