Articles → .NET WINDOWS SERVICE → Schedule Console Application Like Windows Service

Schedule Console Application Like Windows Service






Create A Console Application




File.WriteAllText(
  string.Format(@ "c:\temp\Files\{0}.txt", System.Guid.NewGuid()),
  string.Format("Files written at {0}", DateTime.Now)
);







Schedule An Application




  1. Open windows task scheduler (Start – All Programs – Accessories – System tools – Task Scheduler).
  2. Click on Task Scheduler Library
  3. On the right hand side click on ‘Create Task..’ (See the following screen shot)
  4. Picture showing the Create Task option in the scheduling screen
    Click to Enlarge



    Picture showing the Create Task popup window with the General tab selected
    Click to Enlarge

  5. Enter the name and click on ‘Actions’ tab. Following screen will come
  6. Picture showing the Create Task popup window with the Actions tab selected
    Click to Enlarge

  7. Click on ‘New…’. Following window appears.
  8. Picture showing the New Action popup window
    Click to Enlarge

  9. From the Program/Script section select the exe file and click on Ok (Button will be enabled when you select the exe file)
  10. Go to Triggers tab and click on ‘New..’ button.
  11. Picture showing the Create Task popup window with the Triggers tab selected
    Click to Enlarge

  12. Popup window appears. In the popup window, select the checkbox ‘Repeat task every:’ and select the frequency as 5 minutes.
  13. Picture showing the New Triggers popup window
    Click to Enlarge

  14. Click on Ok to close the popup window and again click ok to close parent window.

Output


Picture showing the text files created when the application runs at the scheduled time
Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Wednesday, July 13, 2016

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250