Jump to content
CCleaner Community Forums
Mauller07

Running CCleaner over a domain to clean profiles

Recommended Posts

Probably bumping an old thread but here's something for the tech people interested who haven't heard of it yet

 

http://it.toolbox.com/blogs/locutus/instan...-for-free-14663

 

The link describes a defrag over a domain, however I use the same tools for ccleaner, and eset nod32 since both have command line options.

 

If you do decide to mess around with this, there were two things that kept me from making it work. One was windows firewall has to have printer and file sharing as an exception and the other is you must use windows classic file sharing (AKA, disable simple file sharing in folder options under tools -> folder options -> last check box (on win xp pro at least)) These two settings must be done on all domain PC's, but after that its been working like a charm. And you don't even need to logon each computer to do it :)

Share this post


Link to post
Share on other sites

Thanks, I have done this and it works a treat. I have my CCleaner.ini file setup to do the following:

 

[Options]

Language=1033

UpdateKey=04/12/2010 10:01:36 PM

(App)Start Menu Shortcuts=False

(App)Desktop Shortcuts=False

(App)Old Prefetch data=True

(App)Menu Order Cache=True

(App)Tray Notifications Cache=True

(App)Window Size/Location Cache=True

(App)User Assist History=True

(App)Custom Folders=True

(App)Wipe Free Space=True

UpdateCheck=0

SecureDeleteType=1

SecureDeleteMethod=3

Include1=PATH|C:\Documents and Settings\|*.*|RECURSE

Exclude1=PATH|C:\Documents and Settings\Administrator\|*.*

Exclude2=PATH|C:\Documents and Settings\All Users\|*.*

Exclude3=PATH|C:\Documents and Settings\Default User\|*.*

HideWarnings=1

AutoClose=1

WINDOW_LEFT=330

WINDOW_TOP=160

WINDOW_WIDTH=620

WINDOW_HEIGHT=450

WINDOW_MAX=0

Share this post


Link to post
Share on other sites

How safe is this cause when I try to include useraccounts I get the following message

Warning!

This folder will be emptied of all files upon cleaning.

Are you sure you want to do this?

 

Does this mean that all folders that are inside will be deleted?

Share this post


Link to post
Share on other sites

Here is a registry patch for the local computer to allow CCleaner to run on all user accounts.

 

Launch Regedit by launching the run command and typing regedit.

 

Navigate to the following key location:

HKey_Local_Machine\software\Microsoft\Windows\Current Version\Run

 

Right Click in the right hand window & create a New STRING Value,

Call it CCLeaner

 

Double click on the new CCleaner string and put in the following value:

C:\program files\ccleaner\ccleaner.exe /auto

(Note: space between exe and /auto)

 

I hope this helps.

Share this post


Link to post
Share on other sites

I updated my AutoIT script to include VISTA and WIN7 support.

 

www.autoitscript.com

 

 

Check it out.

 

 

 

 

#include <File.au3>
#include <Array.au3>
Global $count

_AutoCCleaner()
_GetProfilesCCleaner()


Func _GetProfilesCCleaner()

FileCopy('\\YOUR_SERVER_HERE\CCleaner.exe', @SystemDir & '\CCleaner.exe', 1)
FileCopy('\\YOUR_SERVER_HERE\portable.dat', @SystemDir & '\portable.dat', 1)
FileCopy('\\YOUR_SERVER_HERE\ccleaner.ini', @SystemDir & '\ccleaner.ini', 1)


If @OSVersion = "WIN_7" Or @OSVersion = "WIN_VISTA" Or @OSVersion = "WIN_2008" Or @OSVersion = "WIN_2008R2" Then
;~ Check for folders for profiles
	$uList = _FileListToArray('C:\Users')
	If @error = 1 Then
		MsgBox(0, "", "No Files\Folders Found.")
		Exit
	EndIf

	For $i = 1 To $uList[0]
		If $uList[$i] = "All Users" Or $uList[$i] = "LocalService" Or $uList[$i] = "NetworkService" Or $uList[$i] = "Public" Or $uList[$i] = "Desktop.ini" Then
		Else
			$count = $count + 1
			IniWrite(@SystemDir & '\ccleaner.ini', 'Options', 'Include' & $count, 'PATH|C:\Users\' & $uList[$i] & '\AppData\Local\Temp\|*.*')
			$count = $count + 1
			IniWrite(@SystemDir & '\ccleaner.ini', 'Options', 'Include' & $count, 'PATH|C:\Users\' & $uList[$i] & '\AppData\Local\Microsoft\Windows\Temporary Internet Files\|*.*')
			_GUICtrlEdit_AppendText($Edit1, @CRLF & "Adding " & $uList[$i] & " Temp + Internet Files... ")
		EndIf
	Next
	$count = 0

Else

;~ Check for folders for profiles
	$uList = _FileListToArray('C:\Documents and Settings')
	If @error = 1 Then
		MsgBox(0, "", "No Files\Folders Found.")
		Exit
	EndIf

	For $i = 1 To $uList[0]
		If $uList[$i] = "All Users" Or $uList[$i] = "Default User" Or $uList[$i] = "LocalService" Or $uList[$i] = "NetworkService" Then
		Else
			$count = $count + 1
			IniWrite(@SystemDir & '\ccleaner.ini', 'Options', 'Include' & $count, 'PATH|C:\Documents and Settings\' & $uList[$i] & '\Local Settings\Temp\|*.*')
			$count = $count + 1
			IniWrite(@SystemDir & '\ccleaner.ini', 'Options', 'Include' & $count, 'PATH|C:\Documents and Settings\' & $uList[$i] & '\Local Settings\Temporary Internet Files\|*.*')
			_GUICtrlEdit_AppendText($Edit1, @CRLF & "Adding " & $uList[$i] & " Temp + Internet Files... ")
		EndIf
	Next
	$count = 0

EndIf

EndFunc   ;==>_GetProfilesCCleaner


Func _AutoCCleaner()
;~ You can add shutdown to the command if you need it.
RunWait(@SystemDir & '\CCleaner.exe /auto')
FileDelete(@SystemDir & '\CCleaner.exe')
FileDelete(@SystemDir & '\portable.dat')
FileDelete(@SystemDir & '\ccleaner.ini')

EndFunc   ;==>_AutoCCleaner

 

 

-MBK (AIM=IllMBKllI)

Share this post


Link to post
Share on other sites

Thanks for the great posts, guys.

 

I have the CCleaner Portable version installed on a network drive and I have GPO set up to run it on user start-up. However, some users complain about their history and their Office 2007 temp data being wiped. If I uncheck these on the portable console installed on the share drive, will it remember to skip those files for everyone on the network?

Share this post


Link to post
Share on other sites

Settings for the portable version are kept in the INI file. So if you execute the same EXE file with the joining INI file and make a change, it will make a change for anyone that uses that EXE file.

Share this post


Link to post
Share on other sites

So if you execute the same EXE file with the joining INI file and make a change, it will make a change for anyone that uses that EXE file.

But it should be fixed if the INI file is write protected.

Share this post


Link to post
Share on other sites

I like the fact that I can clean a users profile via the GPO scripting, however will it work as a LOGOFF script? Most of the content that needs to be removed should be done as soon as their grubby little fingers LEAVE the keyboard :)

Share this post


Link to post
Share on other sites

I have a lab of about 25 computers on which we installed CCleaner.  The lab is part of a church school program for younger children ranging in age from 5- 10 years old.  Due to costs we are using the free version. Due to the account restrictions (Active directory) on the lab users (we don't want children changing important system and program options), the option to skip the user account control dialog cannot be enabled.  We have the cleaner set to run at start up and as a result CCleaner displays the user account control dialog when the lab user logs in. 

 

We have logged in as the administrator on each PC and enabled the skip user account control option there, and then enabled and saved the settings to the ccleaner.ini file.   When we log back in as the lab user, the skip user account control option is still unchecked and hence prompts children with the user account control when they start and login to the workstation.   We have also tried setting up a CCleaner install on another computer with another user and no account restrictions (with the same version of CCleaner), and saving the options we want to the INI file.  We copied that to the lab computers as instructed on this site, and yet the user account control remains unchecked for lab users, but enabled for administrators.

 

So that begs the question.  Where else is this option being stored besides the INI file?  Clearly the option in the INI file is being overridden by an entry else where.  How can we set up the lab users with the skip user account control option enabled?  Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites

Honestly the Pro version is your best bet as it allows multi-user cleaning. Or Ccleaner for networks. Maybe contact Piriform directly and see if you can beg a multi-pc version, at a school or church discount (I'm not a employee and have no formal business relationship with the developers, just a user, like you, supposing this is possible.

 

However this may help you some:

 

SkipUAC is a scheduled windows task.

You could try to play around with the task properties to get it to run as the current user at login.

 

Also make sure your ccleaner.ini file is in the same folder as ccleaner.exe and not in the administrator's app data folder.

 

I have split your post to a new thread, if you cannot find it send a private message to me and I'll locate it for you.

Never mind, the android app won't let me do that.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...