Running CCleaner at logoff on Windows7 Home Premium

Running CCleaner at shut down or logoff does not always seem easy on Window7.

Have been searching the web for a few days, but did not found what I was looking for.

Most of the solutions on the web suppose that you can use gpedit to edit the group policies, but this is not possible on basic or home versions of Windows 7.

After trying out different task configurations, I noticed that it was possible to start a task on an event.

I have examined the events logs en found the following events in the security log:

- the security event in source 'Microsoft Windows security auditing' with id 4647, which happens on logoff.

- the security event in source 'Eventlog' with id 1100, which happens at shut down.

So I created a new task:

- It is important that you check the option to run the task, even if the user is not logged on.

- Don't check the option for not saving a password: when saving tha task you wil have to specify a user (with administrator rights) and a password.

- Check the option so the tasks runs with the most possible authority.

Now create two triggers on the task, for both events.

- Just use the standard events and log books.

- For the first event select logbook Security, source 'Microsoft Windows security auditing' end set the id equal to 4647.

- For the second event select logbook Security, source 'Eventlog' end set the id equal to 1100.

Then set the action:

- select start a program

- select "C:\Program Files\CCleaner\CCleaner.exe"

- define one parameter /AUTO

This should do it. It works fine for me under Windows 7 Home Premium (Dutch version)

Suppose this wil also run in Vista Home premium. Wasn't able to test this.

Did the test with Vista Business on a laptop. Runs fine too, but had to use another id for the logoff (4634)

Hope this can be of any help. A lot to find on the web, bet not always usable. :rolleyes: