0

I'm not sure if it's possible anyway. But my question is, can I force a program to not show any dialogs when I run it with process.Start()?

I have a program where I call another program in a foreach loop. It is a fileconverter. Unfortunately some files don't exist any more or the user gives the wrong filepath. If that happens, the converter shows an error with a messagebox. But i don't want to see that box, because if the user wants to convert 10000 files, but has the wrong path in settings, 10000 messagboxes appear and force the system to crash.

I have tried to kill these processes but they have the same name in the processes as the converter itself. I can handle it with a Thread.Sleep but then my mouse is flickering all the time while my thread is running. This is just a little bit better than the messageboxes.

If there is a way, I would be very thankful if you could tell me :)

Regards Schlinger

David Watts
  • 2,249
  • 22
  • 33
Schlinger
  • 50
  • 8
  • You can try [to close](http://stackoverflow.com/q/11729281/1997232) that MessageBox. Or try to find a designated for batch processing command line tool. – Sinatr Dec 16 '15 at 13:03
  • This is what i do at the moment, but for that i have to call Thread.sleep(50) and this is causing the mouse to flicker. If It flickers then everywhere, not only in my programm. If i wouldn't sleep, it would kill my process that is converting the file and so no output would be generated. – Schlinger Dec 16 '15 at 13:13
  • What OS you're targeting? – Luca Dec 16 '15 at 14:48
  • It's windows 7 or higher – Schlinger Dec 16 '15 at 16:23

1 Answers1

0

Most probably it's not possible. There is no built-in way to prevent any executable to show any dialog box.

Depending on the executable you're running, with some luck it might expose a command line version that accepts some quiet or noui parameter, but it's unlikely.

Or you could try programmatically closing those dialog boxes, as suggested.

ken2k
  • 48,145
  • 10
  • 116
  • 176
  • Is there a way to force the mouse to hide while my thread is running and not show the mouse again before the thred is done? – Schlinger Dec 16 '15 at 13:14