Solved Logoff script not running at shutdown

jd33

New member
Local time
5:17 PM
Messages
5
I have a script that launches Ccleaner and needs to run at shutdown. Shutdown scripts do not run within the user space as I understand, so I figured I'd use a logoff script which will run while the user is still logged in. The logoff script works when logging off as expected, but does not run when shutting down.

When you hit the shutdown button, the system first logs the user off then enters the shutdown process, so logically (in my head anyway) a logoff script should run when shutting down the system, yet it doesn't.

Does anyone here know how I can accomplish my goal of running Ccleaner (or any other app that needs to be run while logged in) when the system is shutdown? Please note that I am aware of the alternatives, but I want this to work when clicking "Shut Down", not by ending a batch file with a shutdown command and using that to shut down my system.

Thanks
 

My Computer

OS
W7 Pro 64
Figured it out...

In the batch file I was doing this:

Code:
C:
CD C:\Program Files\Ccleaner\
Ccleaner64.exe /AUTO

That ran fine as a logoff script when logging off, but would not run when shutting down, as it should have, I don't know why. But once I added "C:\Program Files\Ccleaner\" to my system path and changed the batch file to simply:

Code:
Ccleaner64.exe /AUTO

it works.
 

My Computer

OS
W7 Pro 64
Back
Top