Be aware that using the encryption function is not a very high level of security, It is possible to decrypt the text that has been encrypted.
To make it harder for others to decrypt the password please remove the registry value after use.
Using passwords in CapaInstaller Scripting Library
One of the problems using functions that requires password, e.g. when specifying the username and password for a service account, creating a user, etc, is that the password has to be in clear text.
Using CapaInstaller, you can overcome this problem.
Using CapaInstallers own encryption functions, you can set the password for the user using the utility EncPassword.exe that comes with CMS. The file is located in <ProgramFiles>\CapaInstaller\Client\Util.
You set the password from your own computer; the utility encrypts the password and creates a registry import file (.reg file).
This registry file can be distributed and imported into all the computers within your organization that runs the CapaInstaller Client.
This utility comes with the CapaInstaller Script Editor and is installed in the same folder.
Doing this, the password is already encrypted and the user cannot see the password.
Once imported, use can use the encrypted password in CapaInstaller Scripting Library functions by specifying the character * as the password.
The function then use the username specified in the function, and reads and decrypts the password and uses the password inside the CapaInstaller Scripting Library function.
Encrypting a password:
Specify the username and the password. The domain name is optional.
When imported on all your computers, you can use the functions supporting this feature.
Here is an example of the use using Net_MapNetworkDrive:
<Add Function Scripting Guidelines here>
If bStatus Then bStatus=IncludeScript("Includes.cis")
If bStatus Then bStatus=IncludeScript("customlib.cis")
If bStatus Then bStatus=IncludeScriptingLibrary("CapaInstaller Scripting Library.cin")
If bStatus Then bStatus=Job_Start("WS","Mapdrive Job","1.0","Capalib_test.log","INSTALL")
If bStatus Then bStatus=Net_MapNetworkDrive("X:","\\Server\Share (file:///\\Server\Share)",True,"Domain\Username","*")