Scripting

Script File
Password Generator Professional supports sending each password generated to a VBScript script created by you, before returning the password back to the generator and listing it as a generated password.
You can use this feature to add customized actions that you need performed.
Scripting works by choosing in the program which script file you want to load. The scripts can access 3 different variables for each password generated:
| Variable: |
Description: |
| password |
The password generated. When script is loaded, this will contain the generated password, and is returned as the new password after the script has modified it and is done. |
| count |
The number of the password (starts on 1). Can be used to e.g. perform tasks only on certain passwords (e.g. every 2. password). |
| total |
The password quantity chosen to generate in the generation process. |
Some useful VBScript functions you can use are:
Abs
Array
Asc
Atn
CBool
CByte
CCur
CDate
CDbl
Chr
CInt
CLng
Cos
CreateObject
CSng
CStr
Date
DateAdd
DateDiff
DatePart
DateSerial
DateValue
Day
Escape
Eval
Exp
Filter
Fix
FormatCurrency
FormatDateTime
FormatNumber
FormatPercent
|
GetLocale
GetObject
GetRef
Hex
Hour
InputBox
InStr
InStrRev
Int
IsArray
IsDate
IsEmpty
IsNull
IsNumeric
IsObject
Join
LBound
LCase
Left
Len
LoadPicture
Log
LTrim
Mid
Minute
Month
MonthName
MsgBox
Now
Oct
Replace
RGB
|
Right
Rnd
Round
RTrim
ScriptEngine
ScriptEngineBuildVersion
ScriptEngineMajorVersion
ScriptEngineMinorVersion
Second
SetLocale
Sgn
Sin
Space
Split
Sqr
StrComp
String
StrReverse
Tan
Time
Timer
TimeSerial
TimeValue
Trim
TypeName
UBound
UCase
Unescape
VarType
Weekday
WeekdayName
Year
|
Example Scripts
Here is an example script that simply adds some hardcoded text onto each password:
password = password + "-Hello!"
A password generated with this script loaded might look like this: 3iQy45mW-Hello!
Here is another script that adds a random number between 100 and 1000, and also appends the current date and time to the passwords:
Function GetRandomNumber()
Randomize
GetRandomNumber = CStr(Int((1000 - 100 + 1) * Rnd + 100))
End Function
Function GetDateToday()
GetDateToday = CStr(Now)
End Function
password = password + " (" + GetRandomNumber() + ")"
password = password + " - Password generated: " + GetDateToday()
A password generated with this script loaded might look like this: sjBLdZk7 (478) - Password generated: 10.11.2006 08:13:14
For more example scripts, see the Scripts folder in the Password Generator Professional folder.
If the script contains bugs or uses features not available in scripts, an error message will be shown, and Password Generator Professional will attempt to run the script as far as it can without receiving the bug.
Note: When loading scripts to Password Generator Professional, the time needed to generate the passwords will be greatly increased.
Note: We don't provide support help of creating scripts using Microsoft's scripting language VBScript. For help with creating such scripts, please see websites such as W3Schools VBScript Tutorials and Microsoft's VBScript Language Reference.
Note: If you have a Firewall software or similar installed, and you are using Objects in the script such as FileSystemObject for file access, it might not allow the script to be run or will halt/stop it from being executed.
|