Logoff script not running at shutdown


  1. Posts : 5
    W7 Pro 64
       #1

    Logoff script not running at shutdown


    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

  2.   My Computer


  3. Posts : 5
    W7 Pro 64
    Thread Starter
       #3

    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


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 16:05.
Find Us