views:

24

answers:

2

I have run into a case where a Windows Form application is being run regularly via a scheduled task on a Windows Server 2003 box. The GUI is, obviously, not being used to take in any user input, so it is at best pointless. But is it also dangerous? Could it cause anything to go pop on the box?

A: 

The GUI is, obviously, not being used to take in any user input, so it is at best pointless.

Just because it doesn't take input doesn't mean it does nothing. While the GUI part of it is probably pointless, the application execution itself may not be.

A Windows Form application being run regularly is the same as any other process being run regularly, and it may have been for whatever reason that the developer of the app wanted a GUI to appear while it was doing its thing or may have had plans to allow users to interrupt the running process through the GUI.

The developer may even be using a GUI control for application execution. A "good" example of this would be using a web rendering control for its DOM processing capabilities.

Could it cause anything to go pop on the box?

If it doesn't correctly dispose of any resources it uses then yes.

I wouldn't imagine GUI apps are any more notorious than console apps for this, but the fact that someone perhaps unnecessarily used a GUI app (maybe they had only been introduced to WinForms projects) is a strong indicator to check the code and make sure all appropriate resources are being disposed of correctly (think 'using' blocks).

Graphain
Sorry for not being clear. The GUI *is* pointless. The guy just used it as an aid when developing. I take the point about the expected quality of the code developed by someone who would take such an approach.
Yellowfog
But the application executing itself isn't pointless so you can either remove the GUI and convert to a Windows Service as others have suggested or run minimized as one other suggested (the best option if you weren't sure it was pointless and the least hassle either way).
Graphain
The GUI itself should probably be fine though (I'd imagine winforms disposes of itself adequately).
Graphain
A: 

It should not really harm.

You may want to create a standard shortcut to the application then in "properties" select the "Run" -> "Minimized" option.

Don't forget to point the task sceduler to execute the new shortcut rather than the direct application.

JcMalta
Nice idea about the run minimized - the best option if you weren't sure what the GUI was doing/being used for.
Graphain