Jump to content
CCleaner Community Forums
f0rb35

Use CCleaner to Delete Temp Files for All Users

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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"

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×