Welcome, Guest
Please Login or Register.    Lost Password?

Cleanup the system on CodySafe exit with CCleaner
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Cleanup the system on CodySafe exit with CCleaner
#186
Cleanup the system on CodySafe exit with CCleaner 9 Years, 4 Months ago Karma: 14
In this example I'd like to show how the post-run script option may be used to cleanup the PC when you finish work with CodySafe by means of CCleaner.Assumption:CCleaner Portable is installed in X:\PortableApps\CCleaner where X: is drive letter of your CodySafe drive. If CCleaner is not installed you may grab it from official siteLaunch Application Manager from CodySafe Control Panel (click CodySafe icon in tray -> Options -> Applications Manager) Switch to "Scripts" tab.
Example 1 (Batch script)Nothing can be more simple . Just put the following line
Code:

\PortableApps\CCleaner\ccleaner.exe /auto
to Post-run edit box. Set script language to BATCH, click "Close" and you are done. Now each time you finish your work with CodySafe it will launch CCleaner in AUTO mode to perform all defined task silently.Example 2 (VB Script):For those who do not want to run CCleaner on every exit, but want to be prompted, let′s write another simple script there:
Code:

 dim PostRun PostRun=MsgBox("Do you want to execute post-run script?",vbYesNo,"CodySafe Post-run script") If PostRun = vbYes Then  'Put YES CODE HERE!   Sub Run(ByVal sFile,sParam)    Dim shell    Set shell = CreateObject("WScript.Shell")     shell.Run Chr(34) & sFile & Chr(34) & sParam, 1, false    Set shell = Nothing   End Sub   Run "\PortableApps\CCleaner\CCleaner.exe", "/auto" Else  ' NO CODE HERE... Skip the script. End If
Set Script language to "VB Script" and click "Close" button.Now when you exit CodySafe you will be prompted with following message box:
Click "Yes" if you want to run CCleaner this time or "No" to skip...
Last Edit: 2009/07/21 13:22 By Eugene.
The administrator has disabled public write access.
 
#192
Re:Cleanup the system on CodySafe exit with CCleaner 9 Years, 4 Months ago Karma: 2
This is an example of script that will also run application(s) on several computers selectivelyYou can use it if you want to avoid running applications on specific computer. For example, this script runs CCleaner to erase history, cookies, temporary files, etc on all computers except for my home PC (replace "HOME-PC" with your real computer name).
Code:

' Get computer name:Set wshShell = WScript.CreateObject( "WScript.Shell" )strComputerName = wshShell.ExpandEnvironmentStrings( "%COMPUTERNAME%" )If strComputerName <> "HOME-PC" then  dim ScriptRun  ScriptRun=MsgBox("Do you want to execute post- run script and clean traces of your activity?",vbYesNo,"CodySafe Post-run script")  If ScriptRun = vbYes Then    Sub Run(ByVal sFile,sParam)    Dim shell      Set shell = CreateObject("WScript.Shell")      shell.Run Chr(34) & sFile & Chr(34)  & sParam, 1, false      Set shell = Nothing    End Sub    Run "\Program Files\CCleaner\CCleaner.exe", "/auto"  End IfEnd If
The administrator has disabled public write access.
 
Go to topPage: 1
Moderators: Eugene, Igor
get the latest posts directly to your desktop