ChrisJJ
ChrisJJ

Reputation: 2292

How to avoid cmd errors causing GUI dialogs?

In my cmd batch files, how may I avoid OS errors causing GUI dialogs like this

http://img221.imageshack.us/img221/4792/betachriswindowedbetare.png

?

This prevents me using e.g. the Close box. I would like all errors reported to the console.

Upvotes: 0

Views: 107

Answers (1)

Christian.K
Christian.K

Reputation: 49260

How to avoid cmd errors causing GUI dialogs?

In short: you can't.

Windows basically supports two types of (usermode) application types: console (mode) or windows (graphical).

However, there is nothing enforced here. Every console mode application may have GUI elements (e.g. popup a message box in case of an error) and every GUI application may start a console and issue stuff there (see AllocConsole Win32 function).

So unless every application/command you call from your batch file either

  • is a console application that does not exhibit some sort of GUI

or

  • is a GUI application but has specific options to make it "behave" in a batch file / command line environment

there is no way to assure that what you seek.

Upvotes: 1

Related Questions