Jump to content


Use CCleaner to Delete Temp Files for All Users


7 replies to this topic

#1 OFFLINE   f0rb35

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 15 January 2010 - 02:52 AM

Here is a small package I made for work and routinely use it to clean temp files off of the 200-300 windows PCs we have. It uses CCleaner to delete Temp files for ALL USERS of a PC. This was developed under Windows XP SP3 and I have experienced no problems with it running on other Windows OS’s. Feel free to tinker around with it, and if you have any further ideas of things to add, I’d love to hear them.

I can’t wait until something like this is integrated into the program itself. Until then, this is what I use…

How it works…

It’s just a simple WinRAR SFX archive which expands to “C:\Program Files\CCleaner\” and executes a batch file. Inside the archive are 3 files, one magical.

CCleaner.exe (of course)
Ccleaner.txt (the typical settings you choose, not to be confused with ccleaner.ini. you can create your own by saving fresh settings to a ini file, then renaming it. Please remember though, not all settings are global)
CleanUp.bat (the batch scripting which builds the ccleaner.ini file and executes ccleaner.exe)

What CleanUp.bat does is goes out and looks at the "C:\Documents and Settings\" directory. Rather then it clean every subfolder and potentially delete something we should not, it determines (by means of what the subfolder attributes are) which are actually user profiles and which are for system use. Upon determining, it outputs those names to a file called users.txt. This file is then used in a magical script which builds the ccleaner.ini. From there, the lovely ccleaner.exe does the rest.

this cleans out the contents of...
C:\Documents and Settings\***\Cookies\
C:\Documents and Settings\***\Local Settings\Temporary Internet Files\
C:\Documents and Settings\***\Local Settings\Temp\

I know it’s not the best in the world, but it is simple, does the job, and most importantly it works.

-------------------------------------------------------------------------------------


The removed routine can only really be used by it's writer, as it alters CCleaners default settings to those of the writer.

You can restore CCleaners default settings by right clicking each section header and selecting "Restore Default State".

Unfortunately, you won't get any "Includes" or Excludes" back the way they were.


#2 OFFLINE   JonPaulOnLine

    Member

  • Members
  • PipPip
  • 20 posts
  • Gender:Male
  • Location:Philadelphia Pennsylvania USA

Posted 31 January 2010 - 05:59 AM

View Postf0rb35, on Jan 14 2010, 09:52 PM, said:

Here is a small package I made for work and routinely use it to clean temp files off of the 200-300 windows PCs we have. It uses CCleaner to delete Temp files for ALL USERS of a PC. This was developed under Windows XP SP3 and I have experienced no problems with it running on other Windows OS's. Feel free to tinker around with it, and if you have any further ideas of things to add, I'd love to hear them.

I can't wait until something like this is integrated into the program itself. Until then, this is what I use…
How it works…
It's just a simple WinRAR SFX archive which expands to "C:\Program Files\CCleaner\" and executes a batch file. Inside the archive are 3 files, one magical.
CCleaner.exe (of course)
Ccleaner.txt (the typical settings you choose, not to be confused with ccleaner.ini. you can create your own by saving fresh settings to a ini file, then renaming it. Please remember though, not all settings are global)
CleanUp.bat (the batch scripting which builds the ccleaner.ini file and executes ccleaner.exe)
What CleanUp.bat does is goes out and looks at the "C:\Documents and Settings\" directory. Rather then it clean every subfolder and potentially delete something we should not, it determines (by means of what the subfolder attributes are) which are actually user profiles and which are for system use. Upon determining, it outputs those names to a file called users.txt. This file is then used in a magical script which builds the ccleaner.ini. From there, the lovely ccleaner.exe does the rest.
this cleans out the contents of...
C:\Documents and Settings\***\Cookies\
C:\Documents and Settings\***\Local Settings\Temporary Internet Files\
C:\Documents and Settings\***\Local Settings\Temp\
................................................................................
................

I Do This:
o Start a command prompt with start, run, cmd.exe
o Right Click Paste into the command prompt window this----> move "%userprofile%\desktop\ccleaner.lnk" "%allusersprofile%\desktop"



#3 OFFLINE   marmite

    Relax, it's only ones and zeros!

  • Members
  • PipPipPipPip
  • 877 posts
  • Location:UK

Posted 31 January 2010 - 10:37 AM

View PostJonPaulOnLine, on Jan 31 2010, 05:59 AM, said:

I Do This:
o Start a command prompt with start, run, cmd.exe
o Right Click Paste into the command prompt window this----> move "%userprofile%\desktop\ccleaner.lnk" "%allusersprofile%\desktop"
This does not achieve the same result.

As I understand the OP, their code cleans the entire set of user profiles in one pass (excluding the registry for all but the logged-on user of course).

Your suggestion will provide a CCleaner link for any single logged-on user (as opposed to the out-of-the-box behaviour which provides a link only for the profile used to install CCleaner). In order to achieve the same effect as the OP's code, every user with a profile must log on and run CCleaner.

#4 OFFLINE   JonPaulOnLine

    Member

  • Members
  • PipPip
  • 20 posts
  • Gender:Male
  • Location:Philadelphia Pennsylvania USA

Posted 31 January 2010 - 01:57 PM

Correct,
I dont want others touching my password protected portion



#5 OFFLINE   Miss Maria

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 31 January 2010 - 10:30 PM

Thanks

#6 OFFLINE   TronixS

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 02 February 2010 - 04:01 PM

Hi,

sorry where i can find the cleanup.bat??? or what is in this file.

I would like to clean with Schedule Task allusers TEMP Files and all what we don´t need.

best thanx for answer ;)

with best regards
TronixS

#7 OFFLINE   on1wheel

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 06 April 2011 - 05:12 PM

Don't see the files, where can I get them at?

#8 OFFLINE   Augeas

    Moderator

  • Moderators
  • 2,082 posts
  • Gender:Not Telling
  • Location:Worcestershire, UK

Posted 06 April 2011 - 06:29 PM

The routine has been removed from this topic, for the reasons marked in red in the original post.