Jump to content


Adding "Hibernate" Option to CCleaner


7 replies to this topic

#1 OFFLINE   egnm1969

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 17 August 2008 - 10:30 AM

Hi all,
I see that we now have the option to Shutdown the machine once CCleaner is running in the background, but I was wondering would it be possible to add to CCleaner's context menu (in addition to the already existing Shutdown), the option to "Hibernate After Clean", as some people don't necessarily want to completely shutdown their machines, and prefer to just Hibernate once they've finished...

Here's hoping :blink:

Thanks

Ed

#2 OFFLINE   YoKenny

    Super Power User

  • Members
  • PipPipPipPipPip
  • 2,874 posts
  • Gender:Male
  • Location:Oshawa, Ont. Canada
  • Interests:Helping people get rid of malware on their systems then showing them how not to get re-infected again

Posted 17 August 2008 - 10:50 AM

View Postegnm1969, on Aug 17 2008, 06:30 AM, said:

Hi all,
I see that we now have the option to Shutdown the machine once CCleaner is running in the background, but I was wondering would it be possible to add to CCleaner's context menu (in addition to the already existing Shutdown), the option to "Hibernate After Clean", as some people don't necessarily want to completely shutdown their machines, and prefer to just Hibernate once they've finished...

Here's hoping :blink:

Thanks

Ed
There is no hibernate.exe like there is for shutdown.exe in C:\WINDOWS\system32 Folder so I doubt it would be possible.
"Education is what remains after one has forgotten everything he learned in school." - Albert Einstein
IE7Pro user

#3 OFFLINE   mushu13

    Advanced Member

  • Members
  • PipPipPip
  • 99 posts

Posted 17 August 2008 - 04:10 PM

It should be an easy feature to add.


XP + Vista (maybe earlier aswell):
rundll32.exe powrprof.dll,SetSuspendState Hibernate

Vista Only:
shutdown /h
They call them fingers, but I've never seen them fing, or ger. WOAH there they go!!!!!!!
~Otto

How to use CCleaner on a Flash Drive (pre v2.0)

#4 OFFLINE   egnm1969

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 17 August 2008 - 09:18 PM

@mushu13 - Exactly what I was thinking could be added, as I use this command line in Newsleecher to tell it to hibernate when it's finished downloading:

rundll32 powrprof.dll,SetSuspendState

@Yokenny - Close, but no banana ;)

Here's hoping it might be added one day...

:rolleyes:

#5 OFFLINE   Disk4mat

    Power Member

  • Members
  • PipPipPipPip
  • 568 posts
  • Gender:Male
  • Location:Mesa, AZ

Posted 17 August 2008 - 10:03 PM

This can be achieved using WSH.

DIM Wsh
Set Wsh = WScript.CreateObject("WScript.Shell")

Wsh.Run "C:\Program Files\CCleaner\CCleaner.exe /AUTO", 1, True 'The True flag causes WSH to wait for CC to exit
Wsh.Run "RunDll32.exe powrprof.dll,SetSuspendState", 1, False 'We use False flag so WSH isnt running while in hibernate

Set Wsh = nothing
WScript.Quit
Open Notepad. Copy & paste. Adjust the path for CCleaner.exe on line 4 as needed. File menu, Save As (not save) for the file name type: CCSleep.vbs
In the file type box, click the drop down and select "All files"

Edit: This assumes you enabled the option in CC to close after cleaning

#6 OFFLINE   mushu13

    Advanced Member

  • Members
  • PipPipPip
  • 99 posts

Posted 18 August 2008 - 02:00 AM

View PostDisk4mat, on Aug 17 2008, 05:03 PM, said:

Edit: This assumes you enabled the option in CC to close after cleaning
CC always closes automatically with the /AUTO switch.
They call them fingers, but I've never seen them fing, or ger. WOAH there they go!!!!!!!
~Otto

How to use CCleaner on a Flash Drive (pre v2.0)

#7 OFFLINE   Disk4mat

    Power Member

  • Members
  • PipPipPipPip
  • 568 posts
  • Gender:Male
  • Location:Mesa, AZ

Posted 18 August 2008 - 07:57 AM

Thanks for the correction. I picked that up from another thread.

#8 OFFLINE   egnm1969

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 21 August 2008 - 01:35 PM

Haven't I seen you somewhere before on this forum Disk4mat ? :D
Yet again Disk4mat you've outdone yourself :rolleyes: I just tried the script you left and it worked fine apart from one correction. Seems the vbs script under XP only accepts ye olde 8.3 filenaming as I had to rename line 4 to:

Wsh.Run "C:\Progra~1\CCleaner\CCleaner.exe /AUTO", 1, True 'The True flag causes WSH to wait for CC to exit

... as it balked at the Joliet method. Strange but true... it's probably my laptop :lol:

Well this quickfix will do for the mo, and hopefully someone at Piriform might one day incorporate this request into CCleaner to make it even better than it is already now :D

Thanks Disk4mat & everyone else who helped out for this fix... Much appreciated :)