Help - Search - Members
Full Version: Only one instance of CCleaner running.
Piriform Community Forums > Piriform Software > CCleaner Discussion > CCleaner Suggestions
Jamin4u
Write the code in so only one instance of CCleaner can be running at any given time.
Keithuk
QUOTE (Jamin4u @ Sep 12 2009, 11:44 PM) *
Write the code in so only one instance of CCleaner can be running at any given time.


Well I'm sure MrG has been used to VB before because CC was first made with VB. In there you can have code that checks if the app is already running.
CODE
If App.PrevInstance = True Then
    'CC is already running
    'stop this app from running
End If


I'm sure there much be some code in C++ that does the same. wink.gif
ident
QUOTE (Keithuk @ Sep 13 2009, 11:56 AM) *
Well I'm sure MrG has been used to VB before because CC was first made with VB. In there you can have code that checks if the app is already running.
CODE
If App.PrevInstance = True Then
    'CC is already running
    'stop this app from running
End If


I'm sure there much be some code in C++ that does the same. wink.gif


The good old vb6, That code can fail in vb6, If you was on a Server then you would have
to create a unique mutex

No code is needed in vb.net, why i love it.

properties - application - and check "make single instance application"

c++ how ever is a little more difficult, I believe you must add it to a class,


sam
Alan_B
NOT WHAT I WANT.

I am quite happy that a single instance of code should be restricted to one running process,
But I need one process from each of two instances of code to ANALYZE (separately) and to then compare the results simultaneously. I would not be happy if one process would inhibit the launch of the other instance.

I have however no objection to single code instance limiting itself to only run once.

I wish to evaluate a new version against the previous version before I use it.
Ccleaner has never done me harm - but Murphy's Law rules supreme so I always look before I leap.

I have fixed desktop links to the Portable Version held on my "chosen" drive and folder.
Before I update I download the latest version to an adjacent folder and copy the *.ini files from the "chosen" folder.

Then I can launch both versions and ANALYZE - but definitely NOT clean.
Then I can set both Windows to less than full size and compare the results.

If the results are the same I assume the latest version is as effective as the previous, and will do no harm, and even though it appears to give no benefit will update in the hope that it will be a bit faster or have a few bugs removed.

If the new version has found extra stuff to purge, I will carefully evaluate whether it wants to zap something I really need, and if I am happy I welcome the update.

I have not yet observed any reduction in cleaning capability.

If I like the latest version, it is then copied to my "chosen" drive and folder that is the target of desktop links

Regards
Alan
Jamin4u
@Alan_B

I understand that you want to compare two different versions of CCleaner side by side.

QUOTE (Alan_B @ Sep 17 2009, 06:14 AM) *
I have however no objection to single code instance limiting itself to only run once.
This is what I was referring to.

@All members

I have found that if you have CCleaner /Auto as a quick launch and accidentally double click, you will have two instances of the same .exe cleaning simultaneously.


Could this have negative consequences?
ident
QUOTE (Jamin4u @ Sep 17 2009, 11:27 AM) *
Could this have negative consequences?


the second instance just wouldnt find any thing to delete
Alan_B
QUOTE (Jamin4u @ Sep 17 2009, 11:27 AM) *
I have found that if you have CCleaner /Auto as a quick launch and accidentally double click, you will have two instances of the same .exe cleaning simultaneously.

Could this have negative consequences?


I think it might have unexpected consequences - I cannot say what but I would not risk it !

I have just launched CCleaner without any arguments and task manager shows
CPU at 60 % during Analysis,
CPU at 40 % during Cleaning.

I deduce a small possibility that two processes could simultaneously attempt to delete the same file,
which could be interesting, especially if NTFS file permissions get involved.

I use CCleaner /AUTO /SHUTDOWN with 98% success.
About 2% of the time it launches and presumably cleans and closes, but Windows fails to shutdown.
Task Manager shows that about 6 out of 24 processes are no longer running as they normally do.
Once it fails I can invoke it time after time and Windows stays running until I take direct action to shut down.
I assume the first shutdown achieved a 25% success rate at stopping all processes,
and one of the 6 that were closed is vital - without it the other 18 do not get closed.

If two instances of CCleaner are racing neck and neck to the final SHUTDOWN,
I would try to remember where I put my BOOT CD ! ! !

Alan
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.