The easiest solution to this would be to configure the scheduled task to pass in a command line parameter to let the application know who launched it. For example, pass in "SCHEDULER" on the command line and then check for that command-line parameter in your code, as such:
For Each s As String In My.Application.CommandLineArgs
If s = "SCHEDULER" Then
'' do stuff here
End If
Next