Jump to content
CCleaner Community Forums


Recommended Posts

"CCLEANER /AUTO /SHUTDOWN" seems to work, or fails due to race hazards.


There is a 95% chance of failure.


I originally thought there was a 95% chance of success in shutting down,

with a 5% chance that it would abort and Windows Task Manager / Processes would show many "services" processes had been terminated,

and in that situation it was guaranteed that repeating "CCLEANER /AUTO /SHUTDOWN" would NEVER succeed,

I then had to shut-down the computer in the "normal" fashion.


I now find that shutdown is 100% successful so long as CCleaner has NOT previously run since start-up,

and fails 100% if CCleaner was run normally (i.e. without /SHUTDOWN etc.) and then run with /SHUTDOWN.


I believe there is a race hazard.

So long as CCleaner finds and deletes stuff, it takes some time, and the eventual /SHUTDOWN will work.

If CCleaner cannot find anything to delete, it issues /SHUTDOWN incorrectly, and/or Windows "drops the ball" because it has not yet recovered from Launching CCLeaner.

I seem to avoid the problem if I run Firefox a bit after using CCleaner normally before I use it to shut-down.


Would it be better if CCleaner had a 10 second time-out after cleaning before it did the shut-down ?

This should help if it is Windows itself that is dropping the ball.

ALSO - is it dangerous to shut-down instantly after cleaning ?

I am concerned that if CCleaner finds plenty of stuff to clean,

then files are deleted and contents of directories are re-written,

and if CCleaner immediately then does a shut-down, perhaps the cache may not be flushed to the hard drive.

Could this explain the occasional System Event warning

FTDisk The system failed to flush data to the transaction log. Corruption may occur.




Every morning I switch on the battery charger mains supply and after about 1 second the Laptop battery LED comes on for half a second as its overnight leakage is replenished. Then I switch on the laptop and after logging on I can see the battery is 99% fully charged.


Just once, two weeks ago, the LED stayed on continuously, and after waiting 20 seconds I switched on the laptop and logged on. The battery was at 0%, and very gradually a single % point at a time it increased to about 98% after 2 hours.


I strongly suspect that where a /SHUTDOWN failure will kill various services/processes, but leave a visible desktop, it may possibly blank out the monitor so that when I have prepared for bed I can think that shut-down was successful and switch of the mains power supply - but in fact bits of the computer, or perhaps USB peripherals, can still be sucking juice out of the battery till the morning.


I am using XP Home with SP3. and Ccleaner 2.20.920



Link to post
Share on other sites
Notice the version he's using: CCleaner v2.20.920


I did not want to do this, but I have now tried v229

With my existing junk both the old and the new will purge 0.65 MB.

I do NOT like the result summary.

I do NOT like the result details

I want to see ALL the result details at a time,

and NOT have to return to summary and select the next item for detailed results.


Anyway, I will now try shutdown and report back later today whether the problem remains




Link to post
Share on other sites
  • Moderators
I did not want to do this, but I have now tried v229

With my existing junk both the old and the new will purge 0.65 MB.

I do NOT like the result summary.

I do NOT like the result details

I want to see ALL the result details at a time,

and NOT have to return to summary and select the next item for detailed results.


Anyway, I will now try shutdown and report back later today whether the problem remains




I don't like the changes either. However there are known bugs in older versions, some can be lived with an even worked around which is what I do with v2.21.940.


It's worth an update if it might resolve your issue especially if you must rely upon /AUTO /SHUTDOWN. If it doesn't fix anything you could always return to your previous cherished version and avoid the /AUTO /SHUTDOWN altogether since you can tell Windows itself to restart, shutdown, log off the computer using it's built in shutdown command.

Link to post
Share on other sites



v2.29.1111 seems to have identical effects as v2.21.940.


I determined that 3 days ago.

"Unfortunately" both versions shutdown flawlessly now.

I have spent most of the last 3 days using v2.21.940 and trying to repeat the observed problem.


For several months there was a 5% probability of a shutdown disaster.

Then I suspected it might depend upon how much had to be cleansed before shutdown.


My hypothesis was correct.

A "normal" run of CCleaner before a /AUTO /SHUTDOWN always gave a shutdown disaster.

so for a month I never ran CCleaner other than in /AUTO /SHUTDOWN mode,

and every shutdown was perfect.

Being sure of the cause and effect, I started this bug report.


All the above used a script that effectively was



Since then for several weeks I have used, with zero disasters regardless of intermediate cleaning,

SHUTDOWN -s -t 10


The original code and usage that guaranteed a disaster every time, now works flawlessly.


I still believe the shutdown disasters were due to some race hazard,

and suspect that the race is between one chain of events and another chain of events,

and at least one of those chains of events now takes a different amount of time.

Possible causes of time variations are :-

Windows is always fiddling with itself - e.g. prefetch;

My A.V. (Comodo) does Scan on Demand, and perhaps a recent signature update has reduced delay;

Some other problem with Windows - come back DOS ! ! !


I still believe a dis-orderly shut-down might have caused the main battery to be exhausted over-night,

BUT another possibility may those idiots at M.$.

In their efforts to facilitate hackers they fill the system with security holes,

with default enablement of services that a typical user never needs.

When I first received this P.C. I checked and was satisfied that when shut-down there could be no WAKE-UP.

I now find that after replacing a USB Modem by an Ethernet LAN router M.$. have enabled 2 WakeUp on LAN options.

Depending up other system defaults perhaps a hacker attack might have caused a WakeUp,

and then the P.C. ran until the battery was exhausted (mains supply was OFF for the night.)


For now there is no problem with either the old or the new versions of CCleaner.

I will update this topic if there are any developments




Link to post
Share on other sites
  • 2 weeks later...



Nine days ago I moved on to other things and stopped looking at this issue.

30 minutes later it hit me again ! ! !


Whilst I had been testing I omitted a "normal" precaution - I did not launch Windows Task Manager.

As soon as I forgot this issue I reverted to launching Windows Task manager on start-up.


The trigger for this issue seems to include the running of Windows Task Manager at the time of /SHUTDOWN


The problem exists with CCleaner v2.29 as well as v2.20.

I guess v2.30 will be similar,

but there are high priority things I have postponed and now need to deal with.


I have determined that when a /SHUTDOWN is aborted then :-

There is a quick "ting" on the speaker as a subliminal error window flashes on and instantly dissappears,

and when I launch Windows Task manager again it shows these 3 processes were killed as shutdown aborted

TrueImageMonitor.exe, TimounterMonitor.exe, schedhlp.exe

Those were all launched by HKLM:RUN, and are all part of Acronis True Image version 11.

N.B. I have not been running Acronis during these tests

CCleaner v2.29 kills the 3 processes above when it fails

CCleaner v2.20 kills the same, and in addition kills services.exe - ouch thats got to hurt ! !

A v2.29 failure has never yet zapped any desktop icons,

but v2.20 has sometimes removed some or all desktop icons (but recovers when I force a reset.)


The fact that v2.20 has the extra danger of zapping services.exe, and is more variable in desktop effects,

confirms to me the possibility that it may have on one occasion very very very nearly succeeded in achieving power off,

but by the slightest amount failed to get the hardware to shutdown - hence a flat battery the next morning.


When I inspect the System event log I find this warning message :-

Event Type: Warning

Event Source: USER32

Event Category: None

Event ID: 1073

Date: 30/03/2010

Time: 22:00:19


Computer: ACER-311VPBCEH0


The attempt to power off ACER-311VPBCEH0 failed.


I find the above warnings at

30/03/2010 22:00:19

30/03/2010 21:59:04

30/03/2010 20:57:40

30/03/2010 21:56:59

30/03/2010 20:56:20

30/03/2010 18:00:03

30/03/2010 17:49:51

30/03/2010 17:47:36

30/03/2010 17:46:53

30/03/2010 17:45:17

29/03/2010 16:01:05

29/03/2010 15:58:44

29/03/2010 15:55:46


The latest warning, at 30/03/2010 22:00:19, corresponds to the ListTask.log message

30/03/2010 22:00:14.19 "START CCLEANER /AUTO /SHUTDOWN",

i.e. it only took 5 seconds after starting CCleaner for it to crash the system with a failed power off.


Once a shutdown fails, then repeated failure is ALWAYS guaranteed for repeated use of CCleaner /AUTO /SHUTDOWN

The only way to achieve normality is via Start -> Turn Off Computer


I have attached a ZIP of my test folder.

I have omitted Ccleaner.exe from the zip to reduce the zip size,

and avoid problems with A.V. detecting trojans etc. - there are only plain text files.

All that is needed to run this test is to add the PORTABLE version of CCleaner,

either v2.20, or v2.29, or 3.0


To run the test just launch SHUTDOWN.BAT.

This launches ListTask.cmd to list tasks in ListTask.txt, and cumulatively in ListTask.log,

and then it runs CCleaner in manual mode so all junk can be removed (or selected for retention),

and then it uses "START CCLEANER /AUTO /SHUTDOWN" and immediately closes,

and shortly after that CCleaner gets under way, spends a few seconds looking for something to zap,

and then executes /SHUTDOWN - with a bit of luck


Without doing a shutdown you can launch ListTask.cmd with arguments.

I like to do this after a shutdown - especially if the shutdown aborted ! ! !

I suggest dragging a short-cut to the desktop and appending to the target

" SHOW ZERO Action"

e.g. my shortcut target is "H:\New Portable\CCleaner\Clean229\ListTask.cmd" SHOW ZERO Action.

The argument SHOW causes the output ListTask.txt to be displayed and held on PAUSE,

and subsequent arguments become part of the header/trailer for the list of tasks.


If you search for "/SHUTDOOWN" you will find one at 29/03/2010 15:54:24.83,

above which is a logon timestamp of 11:38 from desktop.ini.

After this the next Task list is preceded by the same time stamp,

i.e. no intervening restart/logon because "/SHUTDOWN" was aborted.


To automate detection of a shutdown failure (instead of manual detection),

The scripts were tweaked to take and compare relevant timestamp snapshots,

and announce "FAILED TO REBOOT" where relevant.

To find problems search for "FAILED". The first is at 30/03/2010 17:46:08.35.


A very recent refinement is to append to the list, immediately before /SHUTDOWN,


This gives a timestamp showing when CCleaner was started in /SHUTDOWN mode,

immediately after which the script and CMD.EXE closes.

About 5 to 25 seconds later system event log reports iclose down - or failure to power off.





Link to post
Share on other sites



This is the target of my desktop short cut

"H:\New Portable\CCleaner\Clean229\CCleaner.exe"  /AUTO /SHUTDOWN


With luck it will clean the system and cause a shutdown.

Conversely it will clean the system but shutdown will abort AND trash O.S. shutdown capability,

In which case the shortcut will continue to clean;

but the O.S. will always fail to shutdown until a manual reboot,

(or just possibly an Internet trawl to get more junk and cookies so the /AUTO has something to chew on.)


Piriform developers may find this script useful to easily put the O.S. into "error" non-shutdown mode,

so they can investigate how to fix CCleaner so it will function correctly even when the O.S. has the error.



TASKLIST /NH | FIND /I "taskmgr.exe" > NUL || (START TASKMGR & ping -w 40 -n 4 > NUL)


That tests whether Task Manager is running, and if not it starts it and waits 3 seconds for it to stabilise.

Then it does an auto clean, taking however long it needs to clean the system.

Then its does the auto clean (with nothing to remove) plus the /SHUTDOWN.

There is a slight possibility that /SHUTDOWN will occur before the script regains control,

in which case the system will shutdown without damage, and PAUSE will not occur.

There is a higher probability control will return to the script before the shutdown comes into effect,

in which case it will PAUSE and wait for keyboard,

and because the user is so important it waits for me,

and this aborts the shutdown and cripples any future shutdown capability until after a reboot etc.

If the PAUSE is replaced by a ping delay, then /SHUTDOWN may succeed.

I guess I have priority over /SHUTDOWN, and /SHUTDOWN has priority over PING.


Possibly I would have lower priority if I was not administrator.





That is a guaranteed solution - it ignores any O.S. corruption caused by Kill_Shut.BAT,

and in addition it ensures any caches have been flushed to the disk.

Don't you hate it when the system error logs say it failed with possible data corruption ! ! !


I am using XP Home with SP3 on Acer Travelmate 244LM. and Ccleaner,

protected by Comodo C.I.S. v 3.14.130099.587




Link to post
Share on other sites
  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...