Since Windows lacks the equivalent of a dos batch file, and scheduled tasks sometimes consist of more than a single program, edimatrix have developed a simple


Download 216.66 Kb.
NameSince Windows lacks the equivalent of a dos batch file, and scheduled tasks sometimes consist of more than a single program, edimatrix have developed a simple
page1/5
A typeSchedule
manual-guide.com > manual > Schedule
  1   2   3   4   5
Wintasks

Since Windows lacks the equivalent of a DOS batch file, and scheduled tasks sometimes consist of more than a single program, EDIMatrix have developed a simple 'batch task' program which can be used to remedy this deficiency. Wintasks meets the requirements of most users.
Wintasks has grown over time from a simple sequencer for the running of external executables, through a batch processor, into something which begins to have features of a scripting language. As a scripting language it is limited; as a 'batch file on steroids' it does the job very well. Since it is constantly being enhanced the documentation is unfortunately 'organic' rather than highly structured. If your task logic is so complex that it resembles a conventional program (such as requiring arrays, functions, or complex logical or mathematical expressions), or you have programming experience, then you should consider using one of the many free scripting languages which are available instead of Wintasks. Our design philosophy for Wintasks (and re-formatter scripts) is 'No Brackets or Braces', since they are intended to be used by non-programmers
Wintasks is 'FreeWare'. Whilst EDIMatrix Ltd retain the intellectual property rights, they place no restriction on its use, or its distribution for other than direct commercial gain. EDIMatrix Ltd accept no liability for any consequences of its use, direct or indirect.
Introduction (all variants of Wintasks)

If you want to activate several applications as part of a single scheduled event then you can use the utility WINTASKS . It takes a file name as parameter, which normally has a .tsk extension. If you fail to specify a file then a standard file selection dialogue will be invoked to allow you to select one (as of 97-08-27 if you uncheck the 'read only' box on the file dialog then Notepad will be invoked to allow you to edit the selected task before it is executed). The named file should be a plain text file containing the programs that you wish to run and any command parameters that each requires. You can optionally precede each command on a line with a number between 0 and 9 to indicate which sort of window you wish to run it in (see Window Types at the end of this document). Additionally (since 2017-12-18) you can immediately follow this number by a plus sign (+) to cause the program to be run at high priority. Normally Wintasks will wait for each task to complete before proceeding to the next one. You can, however, precede each command with a number in parentheses to indicate how long in seconds WINTASK should wait for that program to finish before proceeding to the next line (a negative number means do not wait at all). For example if the file MYCMDS.TSK contained:
2 c:\dmx\dmxconst /N new.ctl

(-1) 2 c:\dmx\dmxtrans /N new.ctl

(30) c:\dmx\dmxerran C

(-1) c:\dmx\dmxerran T

c:\dmx\dmxgway

EXIT
then running " WINTASKS MYCMDS.TSK " would cause DMXCONST to be run minimised, and when it had completed processing both DMXTRANS (minimised) and DMXERRAN (normal) would be run. If you had not completed using DMXERRAN within 30 seconds then a second copy would be run to look at the translation log in any case, and the DMX Gateway would be run at the same time.A simpler example would be:
2 c:\dmx\dmxconst /N new.ctl

3 c:\dmx\dmxerran C

EXIT
This would run DMXCONST minimised, and when it had completed would run DMXERRAN maximised. If the preliminary digit had not been present then both would have run as normal windows. The lines in the command file have general form:
[(timeout)] [wintype] program [parameters]
NOTE:

If the 32-bit Wintasks is used to run a 16-bit program (which runs in the WoW subsytem) then Wintasks will assume that the program has finished immediately unless the program has been set to run in its own VDM. This is a characteristic of the Win32 system. You will need to implement other techniques to perform implicit or explicit wait for the termination of a 16-bit program activated from the 32-bit Wintasks. If you need to work with a mixture of 16 and 32 bit programs then the 16-bit Wintasks might be preferable.
Use of relative pathnames in the 32 bit version may also require explicit statement of the current directory; .\bin\dmxconst will work, but bin\dmxconst will not. You may also need to specify the .exe extension for the executable explicitly.
WINTASKS runs using a 5 millisecond resolution timer for external commands i.e. it checks 200 times a second to see if it can proceed to processing of the next command line. Internal comands are processed without any delay. If a command cannot be executed (non-existent program for example) then WINTASKS will ask you if you want to continue or cancel. If you fail to respond within 20 seconds then an 'OK' will be assumed.
(You do not need to terminate a task file with the EXIT command, but we strongly recommend it since some editors have unusual conventions for file end. WINTASKS will terminate processing when it encounters a line starting with "EXIT" or "exit".)
File Operations and Programmable Features

The text above described the original Wintasks program. By popular demand we have included some internal commands for file and logical operations in Wintasks. They are:
:LABEL

REM remarks (commentary)

COPY from_filename to_filename

APPEND from_filename to_filename

MOVE [#] from_filename to_filename

DEL filename

IF [#[f]] argument operator argument ... any internal or external command

IFEXIST filename ... any internal or external command

IFNOTEXIST **obsolescent command - use !IFEXIST**

IFACTIVE exename ... any internal or external command (16-bit)

IFACTIVE process_id ... any internal or external command (32-bit)

IFNOTACTIVE **obsolescent command - use !IFACTIVE**

IFUSED port ... any internal or external command

IFOLDER age filename ... any internal or external command

IFLARGER size filename ... any internal or external command

INPUT "message_text" "default value"

WAIT seconds

CD drive:\directory

MD drive:\directory

GOTO LABEL

GOSUB LABEL

RETURN

FAIL [LABEL]

SAY seconds message

SAY filename message

LOG [dmxgway.rnm]

DLOG filename

FOR [#] filemask ... any command except FOR or IF

SET string_buffer_offset string or %function

JOIN string_buffer_offset string or %function

PERMUTE source mask string_buffer_offset

DISPLAY message

KILL process_id (32-bit)

MATHS [/F="%.nf"] string_buffer_offset operator string or %variable

OPEN [#n] filename

READ [#n] string_buffer_offset

SIZE string_buffer_offset filename

PARSE string_buffer_offset source separator count

EXTRACT string_buffer_offset match_string

CLOG log_type log_text

Note: As of 1999-11-19 the 'IFNOT…' constructs are outmoded, although they are retained for backwards compatibility. The logic of any 'IF…' command can now be inverted by placing an exclamation mark immediately before the command. For example '!IFEXIST' is the same as 'IFNOTEXIST'. This applies even to commands which previously did not have an 'IFNOT…' analogue. Normally an exclamation mark before any other command than an 'IF…' type is ignored.

For example (commands are not case sensitive):
FAIL END

CD c:\dmx

REM Make sure peripherals are available

IFUSED COM1 EXIT

IFUSED LPT1 EXIT

REM Do nothing if Construction active

IFACTIVE dmxconst GOTO END

IFOLDER 7d c:\dmx\test.inh COPY c:\dmx\test.bak c:\dmx\test.inh

DEL c:\dmx\test.bak

MOVE c:\dmx\test.inh c:\dmx\test.bak

:LOOP

IFEXIST c:\dmx\test.bak GOTO DOIT

INPUT "test.bak was not found. Do you want to wait and re-try?" Yes

IF Yes <> % GOTO END

WAIT 10

GOTO LOOP

:DOIT

FAIL

COPY c:\dmx\test.* c:\dmx\temp\

COPY c:\dmx\test.* c:\backup\test$$$$.$$$

SET 0 %!DATE

JOIN 0 " "

JOIN 0 %!TIME

SAY 5 %!0

DISPLAY %!0

PERMUTE %!DATE "CcYyMmDd=Dd/Mm/CcYy" 100

MATHS 0 + %!200

OPEN "read.me"

READ 0

DEL c:\dmx\test.*

IFEXIST c:\dmx\temp\*.* .\bin\popup There is something in TEMP

FOR c:\dmx\temp\*.* GOSUB ANNOUNCE

:END

REM Message appears for 5 seconds

SAY 5 Finished!

EXIT

:ANNOUNCE

(-1) popamo 5 %

RETURN

All internal commands must occur at the start of a line in the task file, or after the filename of an IF... or FOR … construct. MOVE is a ReName function which can only operate with source and destination on the same drive on 16 bit systems. Labels have maximum length 13 characters plus an initial mandatory colon for the label itself, but not for the GOTO references to it (just like DOS). You cannot have a label as the first line in a task (precede it with a REM comment line if you need to jump to task start).
The IFACTIVE and IFNOTACTIVE (outmoded, use !IFACTIVE instead) commands use the name of a windows executable as a parameter (the ".exe" is assumed if not given). Such an executable is active if one or more instances of it are currently running. For example IFNOTACTIVE WINTASKS will always be false! The command IFACTIVE WINTASKS has a special interpretation; since there will always be at least one copy of Wintasks active when it is processed, it returns a true value only if there is at least one *other* Wintask already running. This can be used by those who only ever schedule a single wintask to detect overruns. The implementation of IFACTIVE is not the same for the 16 and 32 bit WINTASKS. In the 16 bit system the parameter is the name of an executable, in the 32 bit system the parameter is a process i.d. obtained via the %!ERROR function after the program has been run from WINTASKS itself.
We have given an example of a REM, used to introduce a comment. This should be done sparingly, since comments waste space in memory. Wintasks are intended to be small and simple.
The LOG command with DMXGWAY.RNM as a parameter will cause Move and Copy commands to write source and destination information to the DMXGWAY.RNM file. This is imported into the Gateway so that it is aware of relevant external file movements. LOG with no parameter turns off this behaviour.
By default if an internal command fails you will get the same sort of message box as for an external command, but the timeout is 5 seconds instead of 2 minutes. If you GOTO a non-existent label then the wintask will terminate with an appropriate error message. If you have used the FAIL command to set a label to an 'error handler' then the normal execution flow will continue there without any message being generated. You can turn off this behaviour by specifying FAIL without any label parameter and revert to the default response.
The INPUT command can be used to prompt a response from the user, and store the result in the '% ' general-purpose variable. For example:
INPUT "Please give the telephone number to be dialled" "01815592454"
Wintasks works with space-delimited arguments, not text strings, so a text string which contains blanks must be enclosed in quotation marks, and cannot itself contain quotation marks, although you can use the caret escape mechanism described elsewhere.
The IF command is syntactically the most complex in Wintasks. It consists of 3 or 4 arguments followed by a command to be executed if the IF condition is true. Normally there are 3 arguments; a string, an operator, and a variable. The variable is resolved to a string and then the desired comparison is made. Before these 3 you can optionally specify a single # character to indicate that the comparison should be integer arithmetic, or #f for a floating point (decimal) arithmetic comparison. A string comparison is case-insensitive, and the comparison takes place for the number of characters corresponding to the length of the first argument. The operator is a blank delimited two-character argument. You must surround it by one or more blanks.
== equal

>= greater than or equal

>> greater than

<< less than

<= less than or equal

<> not equal

~~ wildcard match
Example:

  1   2   3   4   5

Share in:

Related:

Since Windows lacks the equivalent of a dos batch file, and scheduled tasks sometimes consist of more than a single program, edimatrix have developed a simple icon· Scheduled Tasks

Since Windows lacks the equivalent of a dos batch file, and scheduled tasks sometimes consist of more than a single program, edimatrix have developed a simple iconMicrosoft ® ms-dos ®, Windows ®, Windows nt ®, and Apple Macintosh Applications

Since Windows lacks the equivalent of a dos batch file, and scheduled tasks sometimes consist of more than a single program, edimatrix have developed a simple icon1. Batch Imports 1 Batch Import Notes: Welcome to this presentation...

Since Windows lacks the equivalent of a dos batch file, and scheduled tasks sometimes consist of more than a single program, edimatrix have developed a simple iconLanguages: Progress, C/C++, rpgiii, Fortran (IV & 77), vb, C#, Unix...

Since Windows lacks the equivalent of a dos batch file, and scheduled tasks sometimes consist of more than a single program, edimatrix have developed a simple iconThe program prompts for the 'Aware Binary Rad Data File'. Click 'Save'...

Since Windows lacks the equivalent of a dos batch file, and scheduled tasks sometimes consist of more than a single program, edimatrix have developed a simple iconProgram lines consist of a line number from 1 to 65535, then a space

Since Windows lacks the equivalent of a dos batch file, and scheduled tasks sometimes consist of more than a single program, edimatrix have developed a simple icon| Complete index of single Aminet cds, created on 21-Mar-97 | The...

Since Windows lacks the equivalent of a dos batch file, and scheduled tasks sometimes consist of more than a single program, edimatrix have developed a simple iconUser processes do not directly call the process inet when it wants...

Since Windows lacks the equivalent of a dos batch file, and scheduled tasks sometimes consist of more than a single program, edimatrix have developed a simple iconMicrosoft windows ce and windows ce services read me file

Since Windows lacks the equivalent of a dos batch file, and scheduled tasks sometimes consist of more than a single program, edimatrix have developed a simple iconProfile: Professional experience entirely developed on an international...

Since Windows lacks the equivalent of a dos batch file, and scheduled tasks sometimes consist of more than a single program, edimatrix have developed a simple iconMs-dos kermit user guide for the ibm pc family, compatibles, and...

Since Windows lacks the equivalent of a dos batch file, and scheduled tasks sometimes consist of more than a single program, edimatrix have developed a simple iconSet up. The following examples uses the Microsoft Windows Hyper terminal...

Since Windows lacks the equivalent of a dos batch file, and scheduled tasks sometimes consist of more than a single program, edimatrix have developed a simple iconNvidia windows Vista Display inf file; (c) nvidia corporation. [Version]...

Since Windows lacks the equivalent of a dos batch file, and scheduled tasks sometimes consist of more than a single program, edimatrix have developed a simple iconAbstract: This paper defines the internal format of a Windows Imaging...

Since Windows lacks the equivalent of a dos batch file, and scheduled tasks sometimes consist of more than a single program, edimatrix have developed a simple iconThe program is very simple to learn and use, yet is powerful enough...

Since Windows lacks the equivalent of a dos batch file, and scheduled tasks sometimes consist of more than a single program, edimatrix have developed a simple iconAudacity is a free multi-track audio editor. You can use it for recording,...

Since Windows lacks the equivalent of a dos batch file, and scheduled tasks sometimes consist of more than a single program, edimatrix have developed a simple iconHalo 2 for Windows Vista Readme File

Since Windows lacks the equivalent of a dos batch file, and scheduled tasks sometimes consist of more than a single program, edimatrix have developed a simple iconAbstract Microsoft® Windows® Connect Now technology enables simple...

Since Windows lacks the equivalent of a dos batch file, and scheduled tasks sometimes consist of more than a single program, edimatrix have developed a simple iconAbstract Emergency Management Services is a new feature in the Microsoft®...

Since Windows lacks the equivalent of a dos batch file, and scheduled tasks sometimes consist of more than a single program, edimatrix have developed a simple iconObjectives: To create buzzer sound on Dragon12+ Board. To write a...




manual


When copying material provide a link © 2017
contacts
manual-guide.com
search