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..
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sam HobbsPosted Feb 10, 2011, 12:26 AM
ShankeyPosted Feb 10, 2011, 12:01 AM
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.