Command Prompt for Windows

Command LET


Evaluate an expression and set the specified environment variable with the result.


LET variable=expr
variableEnvironment variable name where the result is stored.
exprExpression to evaluate.


Parameter expr follows the same rules as parameter expr for command CALC. Also, when parameter expr includes characters that have a special meaning (eg. <, >, & etc) then enclose the complete expr in brackets, as follows :-

LET variable=( expr )

Examples on using LET.

Also see command SET, XSET, CALC and Batch Files.