i have an application(Windows) using c sharp for file clean up process , but i want to run this application when system shut down or log off..
i want to know how to write code for this problem..
Run my application when system shut down
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

ShankeyRank #972 · 2.1K reputationPosted Feb 9, 2011, 7:01 PM EST
Open the Group Policy snap-in (start - run - gpedit.msc). Under computer configuration - windows setting - scripts, right-click on shutdown, select properties, and add the name of the program you want to run. In general, a script is a batch file or javascript or vb script file, but I've seen windows allow .exe files in some cases as well. Haven't tried it in this particular case, but if it won't allow you to run an executable directly, just create a batch file to run it from, and run the batch file at shutdown...
Please let me know if it works for you.
Sam HobbsRank #107 · 20.5K reputationPosted Feb 9, 2011, 7:26 PM EST