Administration
Working with Batch Files
CLS saves its scripts to DOS batch files. So you can add commands to these batch files just like you would for any other batch file. Below are examples of batch file commands that can be added to introduce programming if needed when implementing CLS services.
Script Execution Error management
If you want specific text to be displayed or logged, or need to call a third party program after a script is successfully executed, or if it has failed, then you can add the ERRORLEVEL command to your batch files.
An example batch file is shown below :
"C:\Program Files\ArticSoft\FileAssurity OpenPGP\bin\scriptor.exe" -encrypt "Paul Winters <pwinters@articsoft.com>" -overwrite -log D:\Temp\log.rtf "D:\Temp\tesdir\download\CHANGES.txt"
IF NOT ERRORLEVEL 0 GOTO SCRIPT_ERROR
echo Script was successfully executed
GOTO END
:SCRIPT_ERROR
echo Script execution failed
:END
---------------
Instead of echoing a message, you can run a different program at that point in the processing. For example, replace
echo Script was successfully executed
with
c:\programfiles\myprogram.exe
This will now run that program before returning control to the next step in the script.
Renaming files
You can use the rename command at the end of a script to rename a decrypted file to one of your choosing rather than having to use the original filename. For example, you might download a file daily from an FTP server that always has the same name but you want to store it in the same location without overwriting existing files of the same name, or you might want to rename it to include today's date. Because the original file name is embedded in the pgp file itself you must decrypt the file to a temporary directory first, then rename it, and then move it to the final directory.
An example batch file to do this is shown below :
"C:\Program Files\ArticSoft\FileAssurity OpenPGP\bin\scriptor.exe" -encrypt "Paul Winters <pwinters@articsoft.com>" -overwrite -log D:\Temp\log.rtf "D:\Temp\tesdir\download\CHANGES.txt"
rename D:\Temp\tesdir\download\CHANGES.txt CHANGES170804.txt
move D:\Temp\tesdir\download\CHANGES170804.txt C:\Working\