Environment Variables
These variables are available for use in your Batch Script. You can also include them in automatically generated emails if you select Separate Email per Download and surround them by percentage signs (e.g. "%WF_DIR%").
The real values are substituted at runtime.
| Variable Name | Notes | Example value/Usage |
|---|---|---|
| WF_REASON | Always FILENEW. | FILENEW |
| WF_DIR | Windows folder synchronized by the current Task. | C:\Sync Me |
| WF_FILE | Complete name of the downloaded file in the Windows folder. | C:\Sync Me\SubDir\NewFile.txt |
| WF_FILE_D | Parent folder of WF_FILE. This always ends with a backslash (\). | C:\Sync Me\SubDir\ |
| WF_FILE_N | Name of WF_FILE without the location. | NewFile.txt |
| WF_FILE_B | Name of WF_FILE without the location and extension. | NewFile |
| WF_FILE_E | File extension of WF_FILE, in capital letters without the leading dot ("."). This is empty for a file without an extension. | TXT |
| WF_RELDIR | The "relative folder" of WF_FILE starting at the specified Local Windows Folder. This is empty if the file is actually in that folder. | SubDir |
| WF_FILE_SIZE | The size in bytes of WF_FILE. | 1204 |
| WF_FILE_SIZE_KB | The size in kilobytes of WF_FILE. This is equal to WF_FILE_SIZE divided by 1024, rounded down. This is zero for files smaller than 1024 bytes. | 64 |
| WF_FILE_DATE_CR, WF_FILE_TIME_CR | These variables contain the creation date (YYYYMMDD) and time (HHMMSS) of WF_FILE. | 20070131 |
| WF_FILE_DATE_LM, WF_FILE_TIME_LM | These variables contain the last modified date (YYYYMMDD) and time (HHMMSS) of WF_FILE. | 20070131 |
| WF_FILE_SHORTPATH | The DOS 8.3 compatible name of WF_FILE. | C:\MONI~001\SUBDIR\NEWF~001.TXT |
| WF_FILE_SHORTNAME | The DOS 8.3 compatible name of WF_FILE without the location. | NEWF~001.TXT |
| WF_INSTDIR | The directory where WatchFTP is installed. | C:\Program Files\WatchFTP |
| WF_TASKDIR | The directory in which your Task information is stored. | C:\UserData\All Users\Application Data\WatchFTP\SyncFTP |
| WF_CONFIG | The name of the Task | SyncFTP |
| WF_CURRUN | Supported in forthcoming versions of WatchFTP. The "run number" of this Task. This is incremented when WatchFTP is started. The current version of WatchFTP always sets this variable to 1. |
|
| WF_CUREVT |
Supported in forthcoming versions of WatchFTP. The "file number" of WF_FILE. The first file downloaded by this Task will have a "File Number" of 1. The next file downloaded will have "2". This variable can be used to create unique filenames. The current version of WatchFTP fills this variable with the number of seconds since January 1, 1970 (so you can still use it to create unique filenames). |
|
| WF_DATE | Current date in the format "YYYYMMDD". | 20050714 |
| WF_TIME | Current time in the format "HHMMSS" (24 hour clock). | 165959 |
| WF_DTTM | Current date and time in the format "YYYYMMDD HHMMSS" (24 hour clock). | 20050714 165959 |
Monitor FTP sites with WatchFTP