0

Here the CMD file itself

cmd /k magick "path\Abaribion.png" -alpha off -statistic StandardDeviation 5x5 -fill White +opaque Black -format "%f, %[fx:mean]" info: >> "path\test.txt"

When I start this CMD file as process as below

        var psInfo = new ProcessStartInfo("complex.cmd");
        var vrProcess = Process.Start(psInfo);
        vrProcess.WaitForExit();

It appears like this how to escape %

enter image description here

MonsterMMORPG
  • 21,378
  • 72
  • 196
  • 320
  • Correct me if I'm wrong, but I don't see anything in your question that actually makes it _about_ C#. The issue presumably would exist however you invoked the `complex.cmd` batch file, whether via a C# program or directly in the command prompt window. In any case, unless you only want people who have the `magick` utility installed on their computer to spend time trying to help, you should fix the question so that it uses a simpler, more broadly-reproducible example. – Peter Duniho Jun 27 '21 at 17:07
  • Almost every question of this nature is (at least partially) solved by _not involving cmd.exe_. There is no need to involve it - just invoke the process you want to run _directly_. – mjwills Jun 27 '21 at 23:35

0 Answers0