You must Sign In to post a response.
  • Category: .NET

    Console app not launching via task scheduler when set to "At StartUp"


    I have implemented a simple console application in C#.Net that writes something to a text file in "C:\MyFolder" as soon as it launches. I have configured the application in task scheduler with the below properties.

    General tab->Run whether user is logged on or not.
    Triggers -> At system start up
    Actions -> Program/Script = Path to my exe ( E:\MyProject\Test.exe)
    Start-in = Path with exe name . (E:\MyProject)

    I am expecting the text file to be present once I start my machine. That is before logging in to the desktop as I have set the property to "At system start up" rather than "At log on" . However only If I log in to the machine, my exe starts running and the file gets copied. Is it because it is a Console App which requires a Desktop/UI to launch.?

    So how will be the case in server machines where we don't have a user login or it gets logged in by default.? How can I make my console application to lauch/ or work in background even before login/ where there is no login?

    Please clarify!!

  • #769524
    Hi Divya,

    Kindly, check the history of your task scheduler. It will show whether your task is executed completely or it throws an exception. If there is an exception, please resolve the issue and configure the same.

    Before doing this trigger, you can just run the scheduler and see whether the application is working or not. If it is working then you can configure this during startup.

    Also, let me know at what purpose your going to do this. If you provide more details, I can provide you a better solution to do the same.

    V.M. Damodharan
    "Your talent will be worthless, when you have fear and tension."

  • Sign In to post your comments