How to run your .net batch programs without showing a dos screen
If you are writing a 'batch' .NET program, that is a program that does not have user interaction- a Console program you may not want the console (the DOS screen) to pop up at all - especially if it is running frequently as a scheduled task in windows.
There are a couple of ways to prevent the DOS screen flashing up every time your program runs. Here's a simple way:
- Create a batch file (Myapp.bat for example) to run your app.
- Create a shortcut (.lnk) to Myapp.bat
- Right click on the shortcut and select Properties
- Change the drop down for Run from Normal to Minimized
- Now run your shortcut. The dos screen should not appear and the program should appear on your taskbar as it runs.
- If it doesn't work for some reason try entering the Target name manually rather than using what was entered when you created it. Sounds nuts but people have found this as a solution when the shortcut still shows the dos prompt
Labels: .net, batch files, console applications, File System
1 Comments:
There is another approach that you have not considered - using the properties configuration.
Post a Comment
Subscribe to Post Comments [Atom]
<< Home