Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am looking for a way to run a script1 when a user logs in2 AND and when they log out3 on their4 Windows5 machine.

Notes:

  1. Perfect world script would mean Powershell script, but any script or application would be acceptable.
  2. Log in can mean at machine start too, but user log in would be ideal.
  3. Log out can mean machine shutdown too, but user log out would be ideal.
  4. This machine is not on a domain.
  5. The Windows version is Windows Vista.
share|improve this question

2 Answers 2

up vote 8 down vote accepted

On a non domain machine you can edit the local machine policy to run scripts at startup and shut down (this may not work in Vista Home edition).

To access this go to start, run then enter gpedit.msc.

In here, expand the user configuration node, then windows settings, then you will find a scripts option where you can set the location of scripts to be run at logon and logoff.

enter image description here

share|improve this answer

Windows Vista's Task Scheduler also supports running scripts at those events.

http://technet.microsoft.com/en-us/appcompat/aa906020.aspx

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.