GenerateGuid

Top  Previous  Next

 

The GenerateGuid Special Function Command allows you to retrieve a new Globally Unique Identifier formatted as a string.

lamp Important: Special Function commands can only be used on the right hand side of a Variable Assignment command.

Command Syntax

 

GenerateGuid,[FormatSpecifier]

 

The comma character after the command is compulsory as is the file name parameter.

 

Parameters:

 

FormatSpecifier: A single character representing one of the set of Microsoft Format Specifiers for Guids

 

The following table shows the accepted format specifiers for the format parameter. "0" represents a digit; hyphens ("-"), braces ("{", "}"), and parentheses ("(", ")") appear as shown.

 

Specifier

Result Format

B

32 digits separated by hyphens, enclosed in braces:

 

{00000000-0000-0000-0000-000000000000}

 

D

32 digits separated by hyphens:

 

00000000-0000-0000-0000-000000000000

 

N

32 digits:

 

00000000000000000000000000000000

 

P

32 digits separated by hyphens, enclosed in parentheses:

 

(00000000-0000-0000-0000-000000000000)

 

X

Four hexadecimal values enclosed in braces, where the fourth value is a subset of eight hexadecimal values that is also enclosed in braces:

 

{0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}

 

The FormatSpecifier parameter is optional. If it is not supplied, the D format specifier will be used by default.If any required parameter is missing or invalid an error will be thrown.

 

Examples:

 

Generate a Guid with the default format

 

Var:Guid=GenerateGuid

 

Generate a Guid separated by hyphens and enclosed in braces

 

 

Var:Guid=GenerateGuid,B

 

See Also: Special Functions GetBuildFileVersion GetFileNameVersion GetMajorFileVersion GetMinorFileVersion GetRevisionFileVersion GetRegistryValue IncrementFileVersion