home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 November / Chip_2000-11_cd2.bin / sharewar / wincron / WinCron.CAB / commands.txt < prev    next >
Encoding:
Text File  |  2000-04-22  |  17.6 KB  |  550 lines

  1. WinCron - Internal Commands Reference (Version: 1.40)
  2. =====================================
  3.  
  4.   INTERNAL commands are built into WinCron. All internal commands
  5. begin with a "$". If a command does not begin with a "$" WinCron
  6. assumes it is an EXTERNAL command and tries to execute it. External
  7. commands are EXE, COM, or BAT files that reside on the hard drive.
  8. WinCron cannot run internal DOS commands (like DIR, COPY etc), however
  9. most internal DOS commands are duplicated with WinCron commands.
  10.  
  11.   Most internal WinCron commands take parameters such as filenames,
  12. strings, or numeric values. Multiple parameters must be separated by
  13. spaces. If a parameter consists of a filename or string that contains
  14. spaces, it must be enclosed within quotes. Some commands (such as
  15. commands that display messages or send keys) should not contain quotes,
  16. or, if included, will be treates as regular characters (see detailed
  17. reference).
  18.  
  19. Example:
  20.     Quotes not required:    $COPY file1.txt file2.txt
  21.     Quotes required:    $COPY "file 1.txt" "file 2.txt"
  22.  
  23.  
  24. Command    Description
  25. -------    -----------
  26. $ASK     - Asks if you want to run a command.
  27. $COMPARE    - Compares two strings
  28. $COPY    - Copies a single file.
  29. $DELAY    - Delays execution.
  30. $DIAL    - Display/start dial-up connection.
  31. $DISABLE - Disables a specified task.
  32. $DISPLAY    - Displays bitmap pictures.
  33. $ENABLE    - Enables a specified task.
  34. $EXIT    - Exits the WinCron program.
  35. $EXITWIN     - Exits Windows in a specific way.
  36. $IF        - Compare two numbers
  37. $IF{condition}    - Checks condition and runs command
  38.     $IFEQUAL
  39.     $IFNOTEQUAL
  40.     $IFLESS    
  41.     $IFGREATER
  42. $IFEXISTS    - Checks if a file exists.
  43. $IFWINDOW    - Checks if a window is open.
  44. $KILL    - Deletes a file.
  45. $LOAD    - Re-loads the task list file.
  46. $LOADNEW    - Loads new task list.
  47. $LOG    - Writes a string to the WinCron log file.
  48. $LOGBACK    - Backs up the wincron log file with the current date.
  49. $MKDIR    - Creates a new directory.
  50. $MSG    - Displays a message string and waits for OK.
  51. $MSGLOG    - Writes a string to the Message log file and displays the log.
  52. $NEWLOG    - Saves the log file using the current date .
  53. $NO    - Executes commandline only if condition was false.
  54. $PLAY    - Plays a media file.
  55. $PROMPT    - Displays a prompt and waits for YES/NO.
  56. $RENAME    - Renames or moves a file.
  57. $RMDIR    - Removes a directory.
  58. $RUN     - Runs a script.
  59. $SAVE    - Saves task list (IE: to record "Last-Run" info).
  60. $SEND    - Sends keys to a specific window.
  61. $KEYS    - Sends keys to the currently active window.
  62. $SETSTRING    - Assigns a string to a variable
  63. $SKIPTO    - skips forward to a labelled line.
  64. $START    - Loads document into associated application.
  65. $STOP    - Aborts processing of the current script.
  66. $WAITSEC - Waits for a specific time.
  67. $WAITWINDOW    - Waits for windows to open or close.
  68. $WRITE    - appends a string to a text file.
  69. $YES    - Executes commandline if condition was true.
  70.  
  71. **Timer Commands:
  72. $COUNTDOWN    - Starts a count-down timer.
  73. $COUNTUP    - Starts a count-up timer.
  74. $IFZERO    - Runs a command if the timer is zero.
  75. $SETTIMER    - Sets the specified timer (0-9).
  76. $TIMER    - Controls the timer operation.
  77. $IFTIMER    - Checks if the timer is active.
  78. $CHECKTIMER - Checks the timer value.
  79.  
  80.  
  81. Detailed Reference:
  82. ===================
  83. Note:    "Sets condition" means:
  84.         If the command was successful the condition is set
  85.         to YES (true), otherwise it is set to NO (false).
  86.     Use the $YES and $NO commands to test the condition
  87.     
  88.     
  89. Command    Description
  90. -------    -----------
  91. $ASK {commandline}
  92.     Displays the task description and commandline and asks you if
  93.     you would like to execute the task.
  94.  
  95.     Note:
  96.     * Processing of additional tasks is halted until a button is
  97.       clicked, so make sure someone is around to see the message!
  98.  
  99. $COMPARE {string1} <=> {string2}
  100.     Compares string1 to string2 and sets the condition. Use the
  101.     $IF{condition} commands to check the result
  102.  
  103.     Example:
  104.         $COMPARE fred <=> barney   ;condition set to GREATER.
  105.         $IFGREATER $MSG Fred is greater than barney
  106.         
  107.     Notes:    * Either string can contain on or more quotes.
  108.         * Useful for comparing string variables
  109.     
  110. $COPY {source} {destination}
  111.     Copies the source file to the destination. The destination
  112.     MUST include a filename. Filename wildcards (*,?) are NOT
  113.     supported. Sets condition.
  114.  
  115.     Example:
  116.     $COPY C:\MY FILES\TEST.TXT C:\FOLDER\TEST.TXT
  117.  
  118. $DELAY {milliseconds}
  119.     Delays for the specified period (Max 60 seconds). One second
  120.     EQUALS 1000 milliseconds. Useful in scripts to delay keystrokes
  121.     sent to other applications with the $SEND or $KEYS commands.
  122.  
  123.     See Also: $WAITSEC, $WAITWINDOW, $IFWINDOW
  124.  
  125. $DIAL {connection} {NOW}
  126.     Brings up a pre-configured and named dial-up-networking
  127.     connection. If NOW is specified the connection will be
  128.     started immediately.
  129.  
  130.     Notes:
  131.     * For Windows 9x ONLY!
  132.     * for un-attended operation the password must be set in
  133.       conjunction with the "Save password" option.
  134.     * If the connection is active this command will display
  135.       the connection status window. The connection can be
  136.       shut down by sending appropriate keystrokes.
  137.  
  138. $DISABLE {ME|taskdescription}
  139.     Disables the specified task from running. To disable the
  140.     current task specify "ME" as the task description.
  141.  
  142.     Note:
  143.     * Can't be used in scripts run from the command-line
  144.     * Matches partial task descriptions. Be careful when naming
  145.       tasks with similar descriptions!
  146.  
  147.  
  148. $DISPLAY {option} {picturefile}
  149.     Displays bitmap pictures in BMP, GIF or JPG format. Displays
  150.     the picture but does NOT stop script execution.
  151.  
  152.     OPTIONS:
  153.     * OPEN: Opens a full-screen window with a black background
  154.         and displays the picture centred in the window.
  155.         Clicking the window closes it.
  156.     * NOCLICK: As above but cannot be closed with mouse click.        
  157.     * CLOSE: closes the display window.
  158.  
  159.     Example: $DISPLAY OPEN splash.bmp
  160.  
  161. $ENABLE {taskdescription}
  162.     Enables the specified task. Useful for enabling tasks that
  163.     only need to run after other tasks have finished or certain
  164.     conditions are met.
  165.  
  166.     Note:
  167.     * Can't be used in scripts run from the command-line
  168.     * Matches partial task descriptions. Be careful when naming
  169.       tasks with similar descriptions!
  170.  
  171. $EXIT
  172.     Exits WinCron immediately.
  173.  
  174. $EXITWIN {method}
  175.     Exits Windows using the specified method:
  176.         LOGOFF, SHUTDOWN, REBOOT, or POWEROFF
  177.  
  178.     The system will exit in a friendly way. If other programs
  179.     are running that can't be terminated the operation will fail.
  180.     If you want to FORCE the method, and make other programs
  181.     exit regardless, add an "!" to the end (IE: REBOOT!).
  182.  
  183.     Note:
  184.     * For Windows 9x ONLY!
  185.  
  186.     CAUTION!:
  187.     * Use this command carefully.
  188.     * Data may be lost if applications are forced to exit!
  189.  
  190. $GETENV {n} {variable}
  191.     Gets the system environment variable and assigns it to the
  192.     numbered string variable {n}.
  193.  
  194.     Example:
  195.         $GETENV 0 path
  196.         $MSG The path is set to: %S0%
  197.     Produces a message similar to:
  198.         The path is set to: C:\DOS;C:\WINDOWS;C:\WINDOWS\COMMAND
  199.  
  200. $IF {n1} {comparison} {n2}
  201.     Compares numbers n1 and n2 and sets the condition.
  202.     Valid comparisons are: =, >, <, <=, >=, <>
  203.  
  204.     Example:
  205.         $IF %sec% > 20
  206.         $YES $MSG The seconds are greater than 20
  207.  
  208.     Notes:    * Does a NUMERIC comparison.
  209.         * Strings are converted to numbers
  210.         * There MUST be a SPACE between each parameter
  211.  
  212. $IFEQUAL {commandline}
  213. $IFNOTEQUAL {commandline}
  214. $IFLESS {commandline}
  215. $IFGREATER {commandline}
  216. $IFLE {commandline}
  217. $IFGE {commandline}
  218.     Runs the commandline if the condition matches. You can also
  219.     use the shorthand equivilents: $EQ, $NE, $LT, $GT, $LE, $GE
  220.  
  221.     $LE = Less than or equal to
  222.     $GE = Greater than or equal to
  223.  
  224.  
  225. $IFEXISTS {filename}
  226. $EXISTS {filename}
  227.     Checks if a file exists. Sets the condition to YES if the file
  228.     exists, or NO if it doesn't.
  229.  
  230.     Example script:
  231.         $EXISTS c:\test.txt
  232.         $YES $MSG The file exists.
  233.         $NO $MSG The file does not exist.
  234.  
  235. $IFWINDOW "{title}"
  236.     Sets the condition to YES if a window is open, or NO if it is not.
  237.  
  238.     Notes:
  239.     * True when any window is open whose titlebar BEGINS with {title}.
  240.     * Not case sensitive.
  241.     * Begin the title with "*" to match string anywhere in the titlebar.
  242.     * Title MUST be enclosed in quotes
  243.  
  244. $KEYS {keylist}
  245.     Sends keys to the currently active window/dialog. Similar
  246.     to the $SEND command except does not activate a window.    See
  247.     the $SEND command for details. ALL keys including quotes if
  248.     specified will be sent. Sets condition.
  249.  
  250. $KILL {filename}
  251.     Deletes a file. Sets condition.
  252.  
  253. $LOAD
  254.     Re-loads the task list file (wincron.dat). Useful if you'd
  255.     like to update tasks while wincron is running.
  256.  
  257.     Notes:
  258.     * Always loads even if tasklist is the same.
  259.     * Caution: "Last run" info from current task list will be lost!
  260.  
  261. $LOADNEW
  262.     Looks for the file "wincron.new" and if it exists replaces the
  263.     current "wincron.dat" file and re-loads the new task list.
  264.     Similar to $LOAD except only updates when nessesary.
  265.  
  266.     Note:    
  267.     * Caution: "Last run" info from current task list will be lost!
  268.  
  269. $LOG {string}
  270.     Writes the string to the event log file (wincron.log). Always
  271.     writes even if logging for the event is not enabled. Writes
  272.     exact string, including quotes.
  273.  
  274.     Note:
  275.     * If no string is specified then the event description will
  276.       be written to the log (the same as if you had left the exe
  277.       field blank).
  278.  
  279. $LOGBACK
  280.     Backs up the log file with the current date (YYYYMMDD.log).
  281.     The current log is NOT erased.
  282.  
  283. $MKDIR {directoryname}
  284.     Creates (makes) a new directory. Sets condition.
  285.  
  286. $MSG {icon} {string}
  287.     Displays the message string and waits for OK. Writes exact
  288.     string, including quotes. To add an optional icon to the message
  289.     include one of the following at the beginning:
  290.  
  291.         -x    Critical
  292.         -?    Question
  293.         -!    Exclamation
  294.         -i    Information
  295.  
  296.     Examples:
  297.         $MSG Time to go home!
  298.         $MSG -x Oh no!
  299.  
  300.     Note:
  301.     * Processing of additional tasks is halted until the OK button
  302.       is clicked, so make sure someone is around to respond!
  303.     * See also $MSGLOG
  304.  
  305. $MSGLOG {option} {string}
  306.     Writes the string to the Message log file (message.log) and
  307.     displays the messages window if not visible. The CLEAR button
  308.     will erase all messages and start a new log file. Use this
  309.     command when you need to display messages but do not wish to
  310.     stop processing of additional tasks (like the $MSG command).
  311.  
  312.     If -x option is specified only the file will be updated. The
  313.     message window will not update or appear.
  314.  
  315.     Note:
  316.     * The Log size is unlimited, however the maximum that can be
  317.       displayed in the window is the first 32,000 bytes.
  318.  
  319. $NEWLOG
  320.     Saves the event log using the current date (YYYYMMDD.log) then
  321.     clears the log.
  322.  
  323.     Notes:
  324.     * Make sure this is only done ONCE a day or the old log will
  325.       be overwritten!
  326.     * A good idea is to set an event to run at 23:59 each day.
  327.  
  328. $NO {commandline}
  329.     Executes the commandline only if previous condition was false.
  330.  
  331. $PLAY {mediafile} {OFF|NOWAIT}
  332.     Uses ActiveMovie2 to play the specified mediafile. Supported
  333.     formats include:
  334.       WAV, MID, MPG, MP3, AVI, MOV, QT, RAM and others.
  335.  
  336.     Notes:
  337.     * $PLAY waits for the file to finish playing before continuing
  338.       unless the NOWAIT option is specified!
  339.     * To stop whatever is currently playing use $PLAY or $PLAY OFF
  340.     * Refer to the README file for instructions on installing
  341.       the ActiveMovie MCI driver.
  342.  
  343. $PROMPT {promptstring}
  344.     Displays the prompt string with YES and NO buttons. Displays
  345.     the exact string, including quotes. The condition is set to
  346.     YES or NO depending on the user's response.
  347.  
  348.     Note:
  349.     * Processing of additional tasks is halted until a button is
  350.       clicked, so make sure someone is around to respond!
  351.  
  352. $RENAME {filename} {new_filename}
  353.     Renames the file to the new filename. Can also move files by
  354.     specifying a different path for "new_filename". Sets condition.
  355.  
  356.     Examples:
  357.       $RENAME TEST.TXT TEST.BAK
  358.       $RENAME "C:\TEST 2.TXT" "C:\BACKUPS\TEST.TXT"
  359.  
  360. $RMDIR {directoryname}
  361.     Removes a directory provided it is completely empty.
  362.     Sets condition.
  363.           
  364. $RUN {scriptname}
  365.     Runs a script (text file) containing WinCron, EXE, or COM
  366.     commands. The script is executed line-by-line. Internal
  367.     variables may be used in any line. See the SCRIPTS section in
  368.     the main documentation file for more details.
  369.  
  370.     Note: Do not use the $RUN command inside a script!
  371.  
  372. $SAVE
  373.     Saves the task list. The "Last run" and "Run count" are also
  374.     saved as part of the task list. 
  375.  
  376. $SEND "{Title}" {keylist}
  377.  
  378.     Activates the window or dialog box with a titlebar containing
  379.     the specified {Title} string, then sends keys to the window.
  380.     The title MUST be enclosed in quotes and there must be a space
  381.     between the title and the keylist. The {keylist} is a list
  382.     consisting of one or more standard or special keys and/or
  383.     key-control commands. See the SENDKEYS reference file for
  384.     {keylist} details.
  385.  
  386.     Notes:
  387.     * If there is no exact match for {Title}, any window/dialog
  388.        whose title string BEGINS with {Title} is activated.
  389.     * To find windows that contain the {Title} string ANYWHERE
  390.       in the title, start the title with a "*".
  391.  
  392.         IE: $SEND "*Netscape" %{F4}
  393.  
  394.         Will send ALT-F4 to the FIRST netscape window.
  395.  
  396.     * If no window can be activated the condition is set to NO.
  397.     * Only works with Windows applications! Does NOT work with
  398.       DOS commands even when run in a window.
  399.     * Keys can't be sent to minimized windows.
  400.     * Title MUST be enclosed in quotes
  401.     * The {keylist} can include quotes anywhere and will be sent
  402.       just like any normal character.
  403.  
  404.     Example:
  405.     To calculate the square root of 69 using the standard
  406.     Windows calculator enter the following command:
  407.         $SEND "Calculator" {DEL}69@
  408.  
  409.     Will send the keys: DELETE,6,9, and @  to the window.
  410.     Special keys are sent by enclosing them in braces. In this
  411.     example the "@" symbol is the keyboard equivilent to clicking
  412.     on the SQRT button inside the calculator.
  413.  
  414. $SETSTRING {n} {string}
  415.     Assigns the string to the numbered string variable (0 to 9).
  416.     The entire string including quotes if included will be assigned
  417.     to the string variable. To use a string variable in another
  418.     command use the form %sN% where 'N' is 0 to 9.
  419.  
  420.     Example:
  421.         $SETSTRING 0 "This is a test"
  422.         $MSG The string is: %s0%
  423.  
  424.     Will display:
  425.         The string is: "This is a test"
  426.  
  427. $SKIPTO {label}
  428.     Skips FORWARD in the script to the specified label. Labels are
  429.     not case sensitive and must be on a line by themselves. Any
  430.     line in a script with a ":" as the first character of the line
  431.     is considered a label.
  432.  
  433.     Script Example:
  434.  
  435.         $IFTIMER 0
  436.         $NO $SKIPTO NoTimer
  437.         $MSG The timer is running
  438.         $SKIPTO Exit
  439.         :NoTimer
  440.         $MSG The timer is not running
  441.         :Exit
  442.  
  443. $START {document}
  444.     Starts the application associated with the specified document
  445.     and loads the document.
  446.  
  447.     IE: $START readme.txt
  448.     - loads the readme.txt file into the application associated 
  449.       with TXT file extensions (usually notepad)
  450.  
  451. $STOP
  452.     Aborts processing of the current script. Can be used in
  453.     conjunction with the $YES and $NO commands or to stop scripts
  454.     from continuing to labeled lines below.
  455.  
  456. $WAITSEC {seconds}
  457.     Waits until the seconds value of the current time is equal to
  458.     or past the specified value (Max 59 seconds). Could be used in
  459.     place of $DELAY when you need to syncronize to a specific time.
  460.  
  461. $WAITWINDOW {OPEN|CLOSE} {Title} {Timeout}
  462.     Waits for window with specified title to open or close. The
  463.     Timeout value determines how long to wait (seconds) before
  464.     continuing. Maximum wait is 60 seconds.
  465.  
  466.     Example: $WAITWINDOW CLOSE "Calculator" 10
  467.  
  468. $WRITE "{filename}" {string}
  469.     Appends the string to the specified file. The filename MUST
  470.     be enclosed in quotes and must be followed by a single space.
  471.     The entire string, including quotes if specified, will be
  472.     written to the file.
  473.  
  474.     Note:    A carriage return will NOT be written to the file unless
  475.         specifically included using the %CR% or %CRLF% variable.
  476.  
  477. $YES {commandline}
  478.     Executes the commandline only if previous condition was true.
  479.  
  480.  
  481. **** Timer Commands ****
  482.  
  483. There are 10 timers, numbered 0 to 9 that you can use for general
  484. purpose timing. Timers work using minutes only.
  485.     * Timers can be STOPPED or ACTIVE
  486.     * Active timers can count UP or DOWN.
  487.     * Active timers can be COUNTING or PAUSED.
  488.  
  489. $COUNTDOWN {n} {minutes}
  490.     Starts a countdown timer from specified minute.
  491.  
  492. $COUNTUP {n}
  493.     Starts an up-counter at zero.
  494.  
  495. $IFZERO {n} {commandline}
  496.     Runs the commandline if the selected timer is zero. If the
  497.     timer is zero this command will stop the timer to ensure the
  498.     commandline only runs once.
  499.  
  500.     Note:
  501.     * The COUNTDOWN/COUNTUP and IFZERO commands are designed
  502.       for simple (non-script) timer operations. For complex
  503.       timing use the commands below.
  504.  
  505. $SETTIMER {n} {minutes}
  506.     Sets the value of the specified timer (0-9).
  507.  
  508. $TIMER {n} {option}
  509.     Controls the timer operation. Valid options are:
  510.     * STARTUP    - Starts timer going up.
  511.     * STARTDOWN    - Starts timer going down.
  512.     * PAUSE        - Pauses the timer.
  513.     * RESUME    - Continues the timer.
  514.     * STOP        - Stops the timer.
  515.  
  516.     Example: $TIMER 0 STARTUP
  517.  
  518. $IFTIMER {n}
  519.     Checks if the timer is active (timing up or down) and sets the
  520.     condition to YES or NO.
  521.  
  522. $CHECKTIMER {n} {minutes}
  523.     Checks the timer and sets the condition to EQUAL, LESS or
  524.     GREATER. Use the $IFEQUAL, $IFLESS or $IFGREATER commands
  525.     to check the result.
  526.     
  527.     NOTE:
  528.     * Does NOT change the timer status (in comparison to $IFZERO)
  529.  
  530.  
  531. Timer example
  532. -------------
  533.  
  534.     Task 1:    DESC: Start timer 0 to count up
  535.         EXE : $COUNTUP 0
  536.  
  537.     Task 2:    DESC: Display message based on 10 minute mark
  538.         EXE : $RUN timer.wcs
  539.         When: Schedule the task to run every minute
  540.  
  541.     TIMER.WCS Script:         
  542.         $IFTIMER 0            ;Is the timer active?
  543.         $NO $STOP            ;No, stop the script
  544.         $CHECKTIMER 0 10        ;Has 10 minutes elapsed?
  545.         $IFLESS $MSG Wait some more...    ;LESS
  546.         $IFEQUAL $MSG 10 minutes is up!    ;EQUAL
  547.         $IFGREATER $MSG Overtime!    ;GREATER
  548.         $IFGREATER $TIMER 0 STOP    ;Stop timer counting
  549.  
  550. <END>