CCleaner /AUTO /SHUTDOWN has a 5% to 99% chance of failure, as I reported on 16th March 2010 in
http://forum.piriform.com/index.php?showtopic=27266
When I first choose to clean and shutdown, there is a 5% chance that the shutdown process will be aborted,
after which repeated attempts have a 99% chance of failure because CCleaner has "gone done something bad."
I experienced it with CC v 2.20.920, and more recently with both 2.35.0.1223 and 3.2.0.1343.
I have Admin authority on XP Home + SP3, and also require /SHUTDOWN to work for my non-admin daughter.
========================================================================================================
THE CURE IS :-
===========
Use a BAT script that concludes with
CCLEANER /AUTO START "ALL DONE" shutdown2.exe -u -t 20 EXIT
This requires the script to be in the same folder as CCleaner.exe,
and shutdown2.exe should either be there also, or perhaps in Windows\System32.
You can download Shutdown2.exe from
http://www.aumha.org/freeware/freeware.php#shutdown'>http://www.aumha.org/freeware/freeware.php#shutdown
The direct download link is
http://www.aumha.org/downloads/shutdown.zip
I trust http://www.aumha.org
If you want a little more excitement you can find various Torrent sites ! ! !
N.B. The above comes in a 14 KB ZIP which when unzipped is 32 KB Shutdown.exe
This works just as well with either its original name or as shutdown2.exe.
The new name is recommended to avoid confusion with the defective shutdown.exe in system32.
N.B. system32 version only works under admin authority and needs arguments :-
START "ALL DONE" SHUTDOWN -s -t 10 -c "CClean + Shutdown" -d p:2:4
The script refrains from using the unreliable CCLEANER /AUTO /SHUTDOWN option,
and instead launches shutdown2 which gives 20 seconds for the script to EXIT and for the O.S. to "do those things we have left undone" ! ! !
I have seen repeated instances where the completion of "CCLEANER /AUTO /SHUTDOWN" has been followed by the EXIT and the end of the BAT script, but 6 or 7 seconds later a small window opens with a progress bar, and for about 6 seconds it announces on 2 lines
Please wait while deleting browsing HistoryDeleting Forms Data
Once it has done that the CCleaner /shutdown is aborted and there-after every time I run the script another 7 seconds of progress bar occurs.
I have in my system event log 24 instances at 40 second intervals of
"The attempt to power off ACER-311VPBCEH0 failed".
I assume that when CCleaner deletes a file it does not flush the disc cache to ensure completion before moving on - it assumes the O.S. will keep everything in order.
My best guesses are that similarly it may depend upon the O.S. to delete Browsing History etc,
and that the first 7 seconds should be long enough to complete but perhaps a flag is not cancelled correctly hence it still took another 7 seconds for each of the next 23 attempts.
========================================================================================================
DIAGNOSTICS :-
===========
When I was using the /SHUTDOWN option there was a 5% chance of failure,
and when it failed the system event log was given the message
"The attempt to power off ACER-311VPBCEH0 failed",
but there was no visible or audible indication of failure, other than the desktop did not vanish.
BUT EVERY SUBSEQUENT ATTEMPT had the same additional error posted in the system event log
and an audible ping as a lightening fast error message popped on and off the screen.
It took me 3 or 4 attempts to read each word. I think the message was to the effect
"Windows is Currently in the middle of a long operation"
To slow down the error message I put a heavy load on the CPU with
CCLEANER /AUTO /SHUTDOWN START "HighPriority Time Gobbler" /HIGH TESTX.BAT EXIT
PLUS the script TESTX.BAT to steal 90% of the processor cycles.
ECHO %TIME% PING 127.0.0.1 -n 2 > NUL REM Without that PING delay the previous script will get no CPU cycles to reach its EXIT SET B=0 ECHO %TIME% %B% FOR /L %%a IN (1,1,99999) DO SET /A B+=1 ECHO %TIME% %B% PAUSE EXIT
The result was almost generally
About 4 seconds after CCLEANER has closed an error message
Windows is Currently in the middle of a long operationEither wait for the operation to finish,
or cancel it before you quit windows
Pig Ignorant Windows never bothers to tell me what the long operation is no matter how essential that information is,
though in this case I guess the "normal priority" operation of the CCleaner invocation of closure has either given up waiting for "High priority" TESTX.BAT to give it some CPU cycles, or maybe the O.S. does not like low priority processes trying to terminate higher priority, BUT the warning could also apply to some other cleansing action that CCleaner previously launched and has not yet terminated.
A further 2 or 3 seconds later there are one (or sometimes two) progress windows
When there are two the lower one is unreadable, obscured by being slightly to the right and below the top window
The top progress Window reads
Please wait while deleting browsing HistoryDeleting Forms Data
The progress bar may remain for 6 seconds before ending
Remarkable features are that the progress bar shows the recycle bin icon
and nothing arrives in the recycle bin
AND THERE IS NOTHING TO DELETE
I have not been on the Internet since start-up,
and I have just run CCleaner in Manual mode with the same INI files and it found nothing to zap
BUT immediately after that I run in /AUTO /SHUTDOWN mode and there appears to be History deletions pending.
I do not see how my TESTX.BAT consumption of CPU cycles can spuriously cause the O.S. to make me
"wait while deleting browsing History"
so I think it is something which CCleaner has done.
The old CCleaner always marked index.dat for deletion and left it for the O.S. to delete on restart.
Are there other/related flags/options that CCleaner may arrange for the O.S. to do.
Incidentally,when I had a run of 24 system event logs of " ... power off ... failed "
there were 3 instances of the message
and each such message was followed 3 seconds later by the nextApplication popup: ping.exe - DLL Initialization Failed : The application failed to initialize because the window station is shutting down
"The attempt to power off ACER-311VPBCEH0 failed"
========================================================================================================
I will give up exploring this problem for now and just live with the shutdown2 solution.
I hope that if a bugfix is developed for this issue then this topic will be updated for the immediate benefit of myself and anyone else with a similar problem.
Regards
Alan