I was thinking I could make a console application that would have a FileSystemWatcher - watching for a .BAT file being created in a folder - and when it sees that file it does a PROCESS.START on it.
Seems simple.
But I'm seeing that a console app doesn't continue running.
How would I go about making this wait and then wait again and again and again?Code:Imports System.IO Module awcWatcher Sub Main() Dim fsw As New FileSystemWatcher("D:\ACS Desktop\AWC\reporting\staging") fsw.NotifyFilter = NotifyFilters.FileName Or NotifyFilters.LastWrite AddHandler fsw.Changed, AddressOf fsw_Changed fsw.EnableRaisingEvents = True End Sub Private Sub fsw_Changed(ByVal sender As Object, ByVal e As FileSystemEventArgs) Debug.WriteLine(e.FullPath) End Sub End Module




Reply With Quote