nnCron Predefined Variables
%hh% |
current hour (00-23) |
%mm% | current minute (00-59) |
%ss% | current second (00-59). |
%MM% | month (01-12) |
%MMM% | month (Jan-Dec) |
%DD% | day of a month (01-31) |
%WW% | day of a week (Mo-Su) |
%WD% | day of a week (1-7, where 1 is Monday, and 7 is Sunday) |
%YYYY% | year (4 digit) |
%YY% | year (last 2 digit) |
%FOUND-FILENAME% |
name of a found file (see FOR-FILES:) |
%FOUND-FULLPATH% | full path and name of a found file (see FOR-FILES:) |
%FOUND-RELPATH% | path and name of a found file relative to the directory where search is performed (see FOR-FILES:) |
%WIN-TITLE% | window title (see "Working with Application Windows") |
%ACTIVE-WINDOW% |
title of the active window (see "Working with Application Windows") |
%FOUND-WINDOW% | title of a found window (see "Working with Application Windows") |
%FOUND-CHILD-WINDOW% | title of a found child window (see FOR-CHILD-WINDOWS:) |
%FOUND-PROC% | the name of the found process (see "Working with processes") |
%FOUND-PID% |
the PID of the found process (see "Working with processes") |
%COMSPEC% | name or the command interpreter (command.com in Win9* and cmd.exe in WinNT/2000/XP) |
%CLIPBOARD% | current contents of the Windows clipboard |
%USERNAME% |
name of the current logged in user |
%CONNECTION% | a list of all active remote connections (conn1, conn2, ...) |
%LAST-CONNECTION% | name of the last remote connection (e.g. for WatchDisconnect) |
%ModuleDirName% | the full path to the directory, where nnCron is installed |
%CHAR X FREE-SPACE% |
amount of free space on disk X: (in kilobytes). For example, for C: drive it will be %CHAR C FREE-SPACE%, for D: drive%CHAR D FREE-SPACE% etc. |
%$0% %$1% .... %$15% | variables used in regular expressions |
%ExitCodeProc% | exit code (error level) of an application. Used after execution of START-APPW: |
%ThreadId% | number of a thread in which a task is started, task process identifier |
%WATCH-PROC-ID% | contains process identifier (PID). This variable is filled after words WatchProc:/WatchProcStop: have been used. It is used as an argument for words used to handle processes. |
%WATCH-SESSIONID% | contains the SessionID.This variable is filled after WTSWatch* words have been used. |
%DRIVE-LETTER% | contains the inserted/removed removable data storage device letter. This variable is filled after words WatchDrive:/WatchDriveRemove: have been used. |
%TempFile% |
contains a unique string which is built in this way: <running number >.<ThreadId>.<TickCounter>, e.g.: 5.120.5434173 Such a string maybe conveniently used, for example, as a unique file name. |
%PrevTempFile% |
contains the previous %TempFile% |
PROC-ID | process identifier (PID) of an application started by nnCron. It is used as an argument for words handling processes. This variable is filled after each time an applications is started successfully (see START-APP:, START-APPW:, QSTART-APP:). |
WIN-HWND | contains window handle of a window. It is filled after most of command having to do with windows (and WIN-EXIST: as well). |
WIN-CHILD-HWND | contains window handle of a child window. This variable is filled inside of the FOR-CHILD-WINDOWS: loop. |
Special folders (variables which return path and name of user folders will contain empty strings unless a user profile is loaded):
Besides, any environment variables, e.g. %PATH%, and any Forth words can also be used as nnCron variables, but in this case an expression must return a string ( addr u) or a 32-bit integer ( n).
Example:
\ the number of milliseconds since system startup, \ will be inserted to a string MSG: "%GetTickCount%"