Tan,

The file deletion process is as follows:
[1] For the primary file only (which is normally your KiXtart script) some extra KiXtart script is tacked onto your script. This extra code immediately attempts first to overwrite, then to delete itself. This works because the entire script is read into memory so the file can be removed. The purpose of this is to leave the unencrypted file around for as short a time as possbile. Once the overwrite/delete has completed control is passed to your own script.

[2] Once your script has finished running the calling program (crypted.exe) checks to see if your script is still present i.e. the delete failed. You will get an warning message that the file is still present, and crypted.exe will itself attempt to overwrite then delete the file.

[3] All support files are then deleted.

In summary, the support files are not deleted until the script has finished running, so you can delete them yourself, rename them, copy them or open/read them in your script.

The only exception to this is if your script "escapes" the controlling crypted.exe, in which case it will think the script has finished and delete the files while the script is running.

You could escape control by RUNning a new process and exiting the original script for instance, or by using the "START" command.

The "-k" option disables step [1] only.
This is useful if your primary file is not a KiXtart script. You might have packaged an executable, an Excel spreadsheet or a DOS batch file in which case adding KiXtart script to the file would render it useless.