Page 1 of 1

Keyword: SETVARO - Value from output

Posted: Tue Jun 22, 2021 6:31 am
by YiMeng
Description
  • Set variable from command (shell) output.


Parameters
  • x: The variable name
  • y: The shell command

Usage
  • SETVARO x = y
  • SETVARO computername = hostname
    • hostname is a windows command that outputs the current computer name, thus assigning the value to the variable computername
  • SETVARO math = set /a 100 + 1
    • math will be assigned value 101 using the command line arithmetic operation
  • SETVARO DESKTOP = echo %HOMEPATH%\Desktop
    FILEMON @@ >> ZIPFILE %FILE% >> %DESKTOP%\backup.zip
    • %HOMEPATH% is a default environment variable in windows and it returns the user home path.
    • %DESKTOP% will thus return user desktop path dynamically
    • This script will save all current automation objects as a zip file to user desktop folder.