1

I have one c# application that is task management application.

when that application is saved any task at that time I save that task into DB and as well as I write one notepad file with this task details in specific folder (in this folder only one notepad file is available at same time).

but my problem is that when user press system shutdown button at that time i want to open that notepad file. In short I want to run some c# script just before system shutdown.

I think it is possible with windows service but how ? I don't know

Please suggest me Thanks is advance.

Darshan Faldu
  • 1,471
  • 2
  • 15
  • 32
  • Did you try this post http://stackoverflow.com/questions/6799955/how-to-detect-windows-shutdown-or-logoff. Let me know if that helps. – Ashutosh Kumar Jul 28 '15 at 10:41
  • [GPO can run scripts](https://technet.microsoft.com/en-us/magazine/dd630947.aspx) that can run executables automatically on logoff/shutdown. You should not do anything that expects user input. – Alex K. Jul 28 '15 at 10:48
  • As windows versions have developed, it's become less and less tolerant of programs that delay shutdown. *why* is shutdown the correct time for your program to *start* new activity? – Damien_The_Unbeliever Jul 28 '15 at 10:52

0 Answers0