Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a standalone windows XP machine which is using pGina 1.8.8 to authenticate. Users log in using a single-sign-on ID (from LDAP) and are then logged into windows XP pro. I have a batch file which I want to run when they log off from the machine. Is this possible?

share|improve this question

migrated from Jun 23 '12 at 22:23

This question came from our site for professional and enthusiast programmers.

Remember that logging off is not the only way to leave a session, you can do a shutdown or simply lose power. – Mark Ransom Jun 20 '12 at 17:58

use the Group Policy console (run gpedit.msc from the run box)

The script to run on shutdown is found under Computer Configuration\Windows Settings and runs under the SYSTEM account

The script to run on logoff is found under User Configuration\Windows Settings and runs under the User account

share|improve this answer
Just to make it clear, you do not need to be in a domain to use gpedit.msc. You can still use it as a "Local group policy" – Scott Chamberlain Jun 24 '12 at 0:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.