Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Logoff script not running at shutdown

17 Jan 2012   #1
jd33

W7 Pro 64
 
 
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 System SpecsSystem Spec
.
17 Jan 2012   #2
FliGi7

XP / Win7 x64 Pro
 
 

My System SpecsSystem Spec
17 Jan 2012   #3
jd33

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 System SpecsSystem Spec
.

Reply

 Logoff script not running at shutdown




Thread Tools





Similar help and support threads
Thread Forum
Enable user account at logoff/shutdown - server 2008 R2
Hi folks. I've got Server 2008 R2 laptop that I need to transfer files to. Frequently, when I reconnect the mapped drive on the source computer, it disables my account on the laptop. Sometimes I forget to check & re-enable it, causing me to get someone to re-enable my account. I created a...
General Discussion
Remove logoff & shutdown gpedit BUG?
Hello, I have followed various tutorials on how to remove the shutdown button in the start menu via gpedit.msc I have done this successfully. I have also been able to remove the start > arrow next to shut down > log off button which greys out. gpedit.msc > user configuration >...
General Discussion
Is there a way to execute a prgm/script at user logoff/shutdown?
In old WinXP there was a tricky feature in Group Policy editor to execute a script when a User logs off resp. the computer was shutdown. I do not find this feature in Windos 7 (pro). is there another way to execute a *.bat batch script at a) user logoff b) shutdown? Peter
General Discussion
Logoff script timeout?
Just wondering if anyone has come across this before. As part of our logoff script we run a backup application to backup users data to the network. In XP we never had a problem, in Windows 7 a few power users have come across a problem. If they have lots of data that's changed, when the script...
General Discussion
Logoff users with a script?
Hello, The issue I have is my co-workers and I share a VM which we remote into, only one person needs access to it at a time. I have been searching for a way that I could set a script to run when I log on which would log off all other users on the system. I have tried to do it with a simple...
General Discussion
Shutdown, LogOff, Sleep, and Hibernation Question?
Hey I was trying to add a task scheduler script to run when the computer logs off, but does Windows log off when shutting down, sleeping, or hibernating? and when does the computer switch between sleep and hibernation? And why does my computer freeze after Sleep/Hibernation (or what could I do to...
General Discussion

Our Sites

Site Links

About Us

Find 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 05:20.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App