Schedule task in VB.NET

K

krallabandi

Hi,

I have a console application written in VB.NET. I schedule the job
using windows 2000 scheduler. It is all working fine but, its opening a
console when it was running. How to disable the console?

any clues?

Thanks.
 
C

Crouchie1998

This is what you can do to get around your problem:

1) Open VS.NET & choose BLANK SOLUTION
2) Add a module to the project
3) Add references to SYSTEM & SYSTEM.WINDOWS.FORMS.DLL
4) Paste in the following code:

------------------------------------------------------------------------------------------------
Imports System

Imports System.Diagnostics

Imports System.Windows.Forms

Module Module1

Sub main()

Dim strStartupPath As String = Application.StartupPath

Dim strFileToRun As String = IO.Path.Combine(strStartupPath, "TestApp.exe")

Dim psi As New ProcessStartInfo(strFileToRun)

psi.WindowStyle = ProcessWindowStyle.Hidden

Process.Start(psi)

End Sub

End Module

------------------------------------------------------------------------------------------------

Obviously, I have made it so that you put your console application that you want to run in the same directory as your BIN directory for this blank solution
Set your Task Scheduler to run the blank solution, which will run your application hidden.

I hope this helps

Crouchie1998
BA (HONS) MCP MCSE
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top