Reads a password. (version 5.3 or later)
getpassword2 <filename> <password name> <password var> <encrypt str>
Retrieves an encrypted password identified by <password name> from the password file <filename>.
The password is decrypted using <encrypt str> and stored in the string variable <password var>.
The same string specified in getpassword2 or setpassword2 command must be specified in <encrypt str>.
If the specified file does not exist, it is newly created.
If the specified password is not stored in the file, the password dialog box appears and the entered password is stored in <password var>.
At the same time, the new password is encrypted and written in the file with the identifier <password name>.
A password file can contain multiple passwords.
Each of them is identified by the password identifier.
getpassword2 'password2.dat' 'foo' password 'Sesame!' connect 'myhost' wait 'login:' sendln 'myname' wait 'password:' sendln password
expandenv str "%USERPROFILE%\password2.dat" getpassword2 str 'foo' password 'Sesame!' if !result then messagebox 'Password was not saved' 'ERROR' endif