Keyword: SETVARO - Value from output

Keywords are used within scripts that enabled powerful features such as dynamic variables, clipboard manipulation, read/write files, mimic inputs and more.
User avatar
YiMeng
Author
Posts: 235
Joined: Sat Jul 18, 2020 10:58 pm
Location: NY
Contact:

Keyword: SETVARO - Value from output

Unread post 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.