21 July 2009
This option was added following multiple requests of advanced users. It provides you with simple yet powerful way to execute commands and applications before launching autorun applications (pre-run script) and/or upon exiting CodySafe
. It may be a very useful feature.
We would like to show here just one simple example of using scripts.
If you want to clean traces of your activity when you finish working on a public PC (Internet café) you will need to run several scripts that remove temporary files, cookies, history, etc. You may write these scripts manually, but we suggest using portable CCleaner
, as a simple and convenient way.
If you have portable CCleaner installed on your CodySafe drive in “\PortableApps\CCleaner” folder, all you need to clean up every time you are leaving a public computer, is to schedule CCleaner to run on every CodySafe exit.
To enable this, first run CCleaner, set the desired options and close it. Then open “Scripts” tab of the CodySafe Applications Manager.
In Post-run section write the following line in edit box:
Set Script language to “Batch Script” and click “Close” button.
You are done! Now on each exit of the CodySafe the CCleaner will perform all defined tasks and exit. Simple, isn’t it?
For those who do not want to run CCleaner on every exit, but want to be prompted, let’s write another simple script there:
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)
Set shell = CreateObject("WScript.Shell")
shell.Run Chr(34) & sFile & Chr(34) & sParam, 1, false
Set shell = Nothing
Run "\PortableApps\CCleaner\CCleaner.exe", "/auto"
' NO CODE HERE... Skip the script.
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…
We believe that you will find this feature useful. You can share your scripts in the special section of the forum.