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:
- Perfect world script would mean Powershell script, but any script or application would be acceptable.
- Log in can mean at machine start too, but user log in would be ideal.
- Log out can mean machine shutdown too, but user log out would be ideal.
- This machine is not on a domain.
- The Windows version is Windows Vista.
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.
Windows Vista's Task Scheduler also supports running scripts at those events.
http://technet.microsoft.com/en-us/appcompat/aa906020.aspx