Jump to content

Running CCleaner over a domain to clean profiles


Mauller07

Recommended Posts

  • 6 months later...

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 :)

Link to comment
Share on other sites

  • 2 months later...

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

Link to comment
Share on other sites

  • 1 month later...

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?

Link to comment
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.

Link to comment
Share on other sites

  • 1 month later...

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)

Link to comment
Share on other sites

  • 10 months later...

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?

Link to comment
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.

25qd6wl.jpg
Link to comment
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.

Link to comment
Share on other sites

  • 4 weeks later...

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 :)

Link to comment
Share on other sites

  • 3 years later...

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.

Link to comment
Share on other sites

  • Moderators

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.

 

ADVICE FOR USING CCleaner'S REGISTRY INTEGRITY SECTION

DON'T JUST CLEAN EVERYTHING THAT'S CHECKED OFF.

Do your Registry Cleaning in small bits (at the very least Check-mark by Check-mark)

ALWAYS BACKUP THE ENTRY, YOU NEVER KNOW WHAT YOU'LL BREAK IF YOU DON'T.

Support at https://support.ccleaner.com/s/?language=en_US

Pro users file a PRIORITY SUPPORT via email support@ccleaner.com

Link to comment
Share on other sites

  • Guest unpinned this topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.