Functions Reference
Refer to Getting Started Guide for information on how to use functions.
The number at the right is the version, from which it is supported.
Dialogs

Input <Question>[,<ImageFile>]

4.1
Asks the user the enter a string. Remember quotes around the question if it can contain commas. The optional imagefile must can be either a skin or an icon file. If the image is excatly 537x165 pixels, it will be used the background and removes the icon. If it is 128x128 or less it will be used as the icon. Png format is generally best because it supports 24 bit colors and transparency.

InputPassword <Question>[,<ImageFile>]

4.1
Same as Input function, but hides text.
Domains / Active Directory

DistinguishedName [<ComputerName>]

5.0
Returns the distinguised name of the computer (requires a reachable Active Directory). Remember that distinguished names contains commas, so quotation around the function may be needed.

FirstOU [<ComputerName>]

5.0
Returns the OU name of the top-most OU in the OU tree the computer is a member of (requires a reachable Active Directory).

LastOU [<ComputerName>]

5.0
Returns the OU name of the bottom-most OU in the OU tree the computer is a member of (requires a reachable Active Directory).

LogonServer

2.0
Current logon server.

UserDescription [<UserName>]

5.7
Users description.

UserDistinguishedName [<UserName>]

5.0
Returns the distinguised name of the user (requires a reachable Active Directory). Remember that distinguished names contains commas, so quotation around the function may be needed. Optional username is the name of a user in the active directory.

UserDomain

2.0
Currently logged on users domain.

UserFirstOU [<UserName>]

5.0
Returns the OU name of the top-most OU in the OU tree the user is a member of (requires a reachable Active Directory). Optional username is the name of a user in the active directory.

UserFullName [<UserName>]

2.0
Users full name.

UserHomeDir [<UserName>]

2.0
Users home directory.

UserHomeDrive [<UserName>]

2.0
Users home drive.

UserLastOU [<UserName>]

5.0
Returns the OU name of the bottom-most OU in the OU tree the user is a member of (requires a reachable Active Directory). Optional username is the name of a user in the active directory.

UserLogonScript [<UserName>]

2.0
Users logon script.

UserName

1.0
Currently logged on username.

UserProfilePath [<UserName>]

2.0
Users roaming profile path if any.
Encoding

HtmlDecode <String>

5.6
Returns the string html decoded.

HtmlEncode <String>

5.6
Returns the string html encoded.

UrlDecode <String>

5.6
Returns the string url decoded.

UrlEncode <String>

5.6
Returns the string url encoded.
Environment

ComputerDomain [<Computer>]

2.0
Computers domain.

ComputerFullName [<Computer>]

2.0
Computers full dns name.

ComputerName

1.0
Computers name.

CurrentDir

1.0
Current directory.

Env <Name>

1.2
Get the value of an environment variable if it exists. If you can, use the internal functions to get the information if you can, environment variables are not reliable in general.

OperatingSystem

2.2
Operating System.

OperatingSystemLanguage

5.7
The ISO 639-2 language code of the operating system (e.g. ENG for English).

OperatingSystemServicePack

2.2
Operating System Service Pack.

OperatingSystemVersion

2.2
Operating System Version.

UserLanguage

5.7
The ISO 639-2 language code of the regional settings of the currently logged on user (e.g. ENG for English).
Folders

AppDataDir

1.0
Application data folder for all users.

CommonFilesDir

1.0
Common Files directory.

DesktopDir

1.0
Common desktop folder for the all users.

DocumentsDir

1.0
Common documents folder for all users.

FavoritesDir

1.0
Common favorites folder for the all users.

FontsDir

1.0
Fonts path.

ProgramFilesDir

1.0
Program Files directory.

ProgramsDir

1.0
Common program icons folder for the all users.

StartMenuDir

1.0
Common Start Menu folder for the all users.

StartUpDir

1.0
Common StartUp folder for the all users.

SystemDir

1.0
Replaced by the system directory.

TempDir

1.0
Temp directory.

TempFile

1.0
Gets a unique temporary filename.

TemplateDir

1.0
Common template folder for the all users.

UserAppDataDir

1.0
Application data folder for current user.

UserCookiesDir

1.0
Cookies folder for the current user.

UserDesktopDir

1.0
Desktop folder for the current user.

UserDocumentsDir

1.0
Documents folder for current user.

UserFavoritesDir

1.0
Favorites folder for the current user.

UserHistoryDir

1.0
History folder for the current user.

UserInternetCacheDir

1.0
Internet cache folder for the current user.

UserPersonalDir

1.0
Personal folder for the current user.

UserProfileDir

1.0
Root of current users profile.

UserProgramsDir

1.0
Program icons folder for the current user.

UserRecentDir

1.0
Recent folder for the current user.

UserRoamingAppDataDir

1.0
Application data folder when user is roaming.

UserSendToDir

1.0
SendToDir folder for the current user.

UserStartMenuDir

1.0
Start Menu folder for the current user.

UserStartUpDir

1.0
StartUp folder for the current user.

UserTemplateDir

1.0
Template folder for the current user.

WinDir

1.0
Windows directory.
GUID

CreateGUID

3.1
Generates a Global Unique Identifier (GUID).
Ini Files

IniValue <IniFile>,<Section>,<Key>

1.0
Gets the setting in an ini file. Returns a blank string or file if not found.
Internal

CurrentInstallName

1.1
Returns the application name in the current script context from RegisterInstallation or UnregisterInstallation, useful for PostInstall.fsh and PostUninstall.fsh.

CurrentInstallVersion

1.1
Returns the application name version in the current script context from RegisterInstallation, useful for PostInstall.fsh.

LastError

1.0
Returns the last execution error, useful for logging in ErrorHandler.fsh.

LastExitCode

1.0
Returns the exit code from the run program.
IO

DirPath <File>

1.0
Gets the directory part of a full file path.

FileContent <File>

1.0
Gets the content of a file. Useful for long messages with ShowMessage. The file content gets parsed for functions, so you can use a file as a template message with [Fullname] and other functions.

FileExtension <File>

1.0
Gets the extension of a a file.

FileName <File>

1.0
Gets the filename part of a full file path.

FileNameCombine <Path>,<FileName>

1.0
Combines a path and a filename to the full path.

FullPath <FileOrDirectory>

1.0
Gets the full path from a relative path or filename.
Menus

ListMenu <HeaderTest>,<ListOfValues>

3.0
Shows a menu with choices in a list with no icons. List must be commaseperated. Returns blank if cancelled.

ListMenuWithoutCancel <HeaderTest>,<ListOfValues>

3.0
Shows a menu with choices in a list with no icons. List must be commaseperated. Returns blank if cancelled.

Menu <HeaderTest>,<ListOfValues>

3.0
Shows a menu with choices and return blank if cancelled or the selected value. List must be commaseperated. Choices must be separated by commas and can by any FastTrack collection or a custom list. Values can start with "<IconName>|" for another icon than the default. Remember to use quotes if any of your choices that contains commas. Use fsh /? to see a list of icons and names.

MenuWithoutCancel <HeaderTest>,<ListOfValues>

3.0
Same a menu but forces a selection.
Network

IPAddress [<Host>]

2.0
IP address of the executing computer unless Host is specified, which can be a hostname or an IP address. If the host has multiple IP adresses, the first obtained one is returned.

IPAddressPart <Index>[,<Host>]

2.0
Returns the specified first number of digits in the ip adddress, for instance the 'IPAddressPart 2' of 127.0.0.1 would be 127.0. Useful for indexing xml files for a specific location.

MacAddress

2.0
Gets the mac adress of the fastest network adapter in the current computer.

NetworkSpeed

2.0
Get the speed in mbit of the fastest network adapter in the current computer.
Registry

RegistryValue <RegistryValue>

1.0
Returns the value of the given registry value or blank if it does not exist. HKey_Local_Machine, HKey_Current_User and HKey_Classes_Root can be abreviated to HKLM, HKCU and HKCR.
Screen

ScreenDepth

2.1
No of bits per pixel.

ScreenDevice

2.1
Screen device name.

ScreenHeight

2.1
Screen height in pixels.

ScreenRefreshRate

2.1
Screen refresh rate in mhz, defaults to 0 if it cannot be retreived.

ScreenWidth

2.1
Screen width in pixels.
Statics

Blank

1.0
Returns an empty string, just for readability in scripts with empty strings.

FastTrackPath

4.1
Replaced by the path to the executing FastTrack engine.

FastTrackVersion

4.1
Replaced by the current FastTrack engine version.

Return

1.0
Replaced by carriage return.
Strings

Char <Value>

1.0
Returns the character of the specified value. Can be used to encode [ and ], like [Char 91] and [Char 93].

IndexOf <String>,<SearchString>

1.0
Gets the position of the searchstring inside the string, can be use to for instance mask ip adresses. Index is zero based, no match will result in -1.

LastIndexOf <String>,<SearchString>

1.0
Gets the last position of the searchstring inside the string, can be use to for instance mask ip adresses. Index is zero based, no match will result in -1.

Left <String>,<Count>

1.0
Gets up to the leftmost "Count" chars of the string, like "if [Left [IPAddress],7]=192.168 Then".

Length <String>

1.0
Gets the length of a string.

Mid <String>,<Start>,<End>

1.0
Gets the middle part of a string.

Random <MaxNumber>

5.7
Returns a random number between 0 and the MaxNumber parameter. Can be used for instance to randomize when logon installations happen, to spread the network load.

Right <String>,<Count>

1.0
Gets up to the rightmost "Count" chars of the string.
SysInfo

BootMode

2.2
Boot mode.

CpuSpeed

2.2
Speed in MHz of the first CPU.

DiskSize [<Drive>:]

2.2
Gets disksize in GB.

FreeDiskSpace [<Drive>:]

2.2
Gets free diskspace in GB. You can use this in loginscript to display a warning when below a threshold. Defaults to the root of the drive windows resides on if nothing else is specified.

NoMonitors

2.3
Number of monitors.

NoProcessors

2.3
Number of processors.

TotalMemory

2.2
Total memory in megabytes.
Terminal Services

TSApplication

4.3
The name of the published application (blank if not available).

TSClientIP

4.3
The ip address of the client running terminal services, can be used to detect the clients location (blank if not available).

TSClientIPPart <1-4>

4.3
Returns the specified first number of digits in the ip address of the client running terminal services (blank if not available).

TSClientName

4.3
The name of the client running terminal services (blank if not available).
Time

Date

1.0
Current date.

Day

1.0
Current day of the month.

Month

1.0
Current month in two digits.

Time

1.0
Current time.

WeekDay

1.0
Current week days name.

Year

1.0
Current year.
Variables

CmdParam <ParameterName>

4.2
Gets a command the line parameter value (specified with /P "ParameterName=Value"), returns blank if it is not specified.

Var <VariableName>

1.0
Value of the specified variable.
XML

XMLAttribute <File>,<Path>,<Attribute>

3.0
Gets the attribute of the value of the first xml node that fits the path. For instance XMLAttribute PrinterList.xls,Settings/Printers/Houston,Server. Returns a blank string if file or attribute is not found.

XMLPairAttribute <File>,<Path>,<PairKey>,<PairValue>,<Attribute>

3.0
Gets the first xml node attribute that fits the path and has an attribute that fits the pairs key and value. Returns a blank string if file or attribute is not found.

XMLValue <File>,<Path>

3.0
Gets the value of the first xml node that fits the path. For instance XMLValue PrinterList.xls,Settings/Printers/Houston. Returns a blank string if file or value is not found.