I have built a windows service that I want to run on every monday and the 2nd and 16th of any given month. The service installed correctly and when I start/restart the service it runs the code, but it doesn't run it on the Mondays, 2nd, or 16th. I put my code in below. Any ideas on why this isn't working. This is my first windows service I have built. I am using a global date variable to hold the the current date as the service runs.
EventLog.WriteEntry("Dup Remover Started")
If Date.Today <> dDate Then
If DatePart(DateInterval.Weekday, Now()) = vbMonday Or DatePart(DateInterval.Day, Now()) = 16 Or DatePart(DateInterval.Day, Now()) = 2 Then
'run dup checker
'Dim CL As New Dupcl.dupClean
EventLog.WriteEntry("Service Started On " & Date.Today)
dDate = Date.Today