Piriform Forum
Return to Piriform  CCleaner  Defraggler  Recuva  Speccy

Welcome Guest ( Log In | Register )

2 Pages V  < 1 2  
Reply to this topicStart new topic
> Running CCleaner over a domain to clean profiles, For network Administrators and Domain controllers
fireryone
post Apr 18 2009, 02:46 AM
Post #21


Lets Get Dangerous
****

Group: Members
Posts: 1,440
Joined: 28-October 06
From: QLD,Australia
Member No.: 7,801



link to another domain cleaning resolution:
http://forum.piriform.com/index.php?showtopic=19066


--------------------
fireryone



There are 10 types of people in this world.
Those who understand binary, and those who don't.
Go to the top of the page
 
+Quote Post
mbkowns
post Jun 4 2009, 02:57 PM
Post #22


Newbie
*

Group: Members
Posts: 3
Joined: 4-June 09
Member No.: 29,109



I wrote an AutoIT script that will parse the profile directory and add lines in the CCleaner.ini file to delete "temp" and "temporary internet files"

This is then just a job that is run in Altiris regardless if users are logged in or out. I also have it deleting CCleaner off the machine after so I don't have to leave it there.

#include <File.au3>
#include <Array.au3>
Global $count
FileCopy('\\YOURSHARE\CCleaner\CCleaner.exe', @SystemDir & '\CCleaner.exe', 1)
FileCopy('\\YOURSHARE\CCleaner\portable.dat', @SystemDir & '\portable.dat', 1)
FileCopy('\\YOURSHARE\CCleaner\ccleaner.ini', @SystemDir & '\ccleaner.ini', 1)

;~ Check for docs and settings for profiles
$uList = _FileListToArray('C:\Documents and Settings')
If @error = 1 Then
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()
IniWrite(@SystemDir & '\ccleaner.ini', 'Options', 'Include' & $count, 'PATH|C:\Documents and Settings\' & $uList[$i] & '\Local Settings\Temp\|*.*')
_Count()
IniWrite(@SystemDir & '\ccleaner.ini', 'Options', 'Include' & $count, 'PATH|C:\Documents and Settings\' & $uList[$i] & '\Local Settings\Temporary Internet Files\|*.*')
EndIf

Next

$count = 0

RunWait(@SystemDir & '\CCleaner.exe')
FileDelete(@SystemDir & '\CCleaner.exe')
FileDelete(@SystemDir & '\portable.dat')
FileDelete(@SystemDir & '\ccleaner.ini')

Func _Count()
$count = $count + 1
EndFunc ;==>_Count
Go to the top of the page
 
+Quote Post
truecolor
post Jun 6 2009, 03:13 AM
Post #23


Newbie
*

Group: Members
Posts: 1
Joined: 6-June 09
Member No.: 29,139



simulation credit auto
Wow. you're really pofessional on this field.
thanks mbkowns so much for your post wink.gif rolleyes.gif
Go to the top of the page
 
+Quote Post
mbkowns
post Jun 9 2009, 10:04 PM
Post #24


Newbie
*

Group: Members
Posts: 3
Joined: 4-June 09
Member No.: 29,109



QUOTE (truecolor @ Jun 6 2009, 03:13 AM) *
simulation credit auto
Wow. you're really pofessional on this field.
thanks mbkowns so much for your post wink.gif rolleyes.gif



Removed the count function didn't need it just how It came out when I wrote it. So in a nutshell below works with less code.


#include <File.au3>
#include <Array.au3>
Global $count
FileCopy('\\YOURSHARE\CCleaner\CCleaner.exe', @SystemDir & '\CCleaner.exe', 1)
FileCopy('\\YOURSHARE\CCleaner\portable.dat', @SystemDir & '\portable.dat', 1)
FileCopy('\\YOURSHARE\CCleaner\ccleaner.ini', @SystemDir & '\ccleaner.ini', 1)

;~ Check for docs and settings for profiles
$uList = _FileListToArray('C:\Documents and Settings')
If @error = 1 Then
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\|*.*')
EndIf
Next


RunWait(@SystemDir & '\CCleaner.exe')
FileDelete(@SystemDir & '\CCleaner.exe')
FileDelete(@SystemDir & '\portable.dat')
FileDelete(@SystemDir & '\ccleaner.ini')
Go to the top of the page
 
+Quote Post
sandymiss
post Jun 25 2009, 06:49 AM
Post #25


Newbie
*

Group: Members
Posts: 1
Joined: 25-June 09
Member No.: 29,531



Thanks so much for sharing the post. laugh.gif

This post has been edited by Andavari: Jun 25 2009, 07:34 AM
Reason for edit: Hidden spam link removed
Go to the top of the page
 
+Quote Post
Andavari
post Jun 25 2009, 07:35 AM
Post #26


Captain Spectacular
Group Icon

Group: Moderators
Posts: 10,076
Joined: 10-November 04
From: Earth
Member No.: 26



sandymiss you are banned for posting a hidden spam link.


--------------------
Go to the top of the page
 
+Quote Post

2 Pages V  < 1 2
Reply to this topicStart new topic

 



RSS Lo-Fi Version Time is now: 21st November 2009 - 07:48 AM