Jump to content

Batch files: Difference between revisions

From EDM2
mNo edit summary
No edit summary
Line 1: Line 1:
Batch files are text files that run system commands in a sequence. The OS/2 system recognises two types of batch files on the form of OS/2 files that have the the file extension '''CMD''' and [[DOS]] batch files that have the extension '''BAT''', but the two types are almost identical except for the fact that the CMD files run inside an OS/2 Command shell and the BAT files inside a DOS Command shell. Most third party command shells have some sort of batch file functionality built in and some have full scripting languages, the [[4OS2]] and [[4DOS]] replacement shells have an batch language very similar to the OS/2-DOS language but with extensions, the 4OS2/DOS files use the '''BTM''' file extension.
Batch files are text files that are used to execute system commands in sequence. The OS/2 system recognises two types of batch files on the form of OS/2 files that have the the file extension '''CMD''' and [[DOS]] batch files that have the extension '''BAT''', but the two types are almost identical except for the fact that the CMD files run inside an OS/2 Command shell and the BAT files inside a DOS Command shell. Most third party command shells have some sort of batch file functionality built in and some have full scripting languages, the [[4OS2]] and [[4DOS]] replacement shells have an batch language very similar to the OS/2-DOS language but with extensions, the 4OS2/DOS batch files use the '''BTM''' file extension.
 
While the DOS market saw a huge number of utility programs released that allowed you to extend the functionality of batch files there was never such a market for batch extenders for OS/2 although a few popped up. This is mainly due to the presence of [[REXX]] as a component of the OS, but since that is a fully fledged programing language, albeit one that is unusually easy to use, you can do literally create the functions you might want from REXX rather than go looking for a third party utility.


==OS/2 Batch file commands==
==OS/2 Batch file commands==
Line 15: Line 17:
*SHIFT
*SHIFT
</div>
</div>
In addition the above commands a batch script can call any valid OS/2 program. Most commands have formatting and options more like a executable than what you would expect from a scripting language. Some batch file commands can also be used from the command line.
In addition the above commands a batch script can call any valid OS/2 program including normal executables, scripts in other languages and system commands. Most batch commands have formatting and options more like a executable than what you would expect from a scripting language. Some batch file commands can also be used from the command line but have limited utility there.


====OS/2 text & programmers editors with OS/2 batch file support====
====OS/2 text & programmers editors with OS/2 batch file support====

Revision as of 02:04, 2 January 2016

Batch files are text files that are used to execute system commands in sequence. The OS/2 system recognises two types of batch files on the form of OS/2 files that have the the file extension CMD and DOS batch files that have the extension BAT, but the two types are almost identical except for the fact that the CMD files run inside an OS/2 Command shell and the BAT files inside a DOS Command shell. Most third party command shells have some sort of batch file functionality built in and some have full scripting languages, the 4OS2 and 4DOS replacement shells have an batch language very similar to the OS/2-DOS language but with extensions, the 4OS2/DOS batch files use the BTM file extension.

While the DOS market saw a huge number of utility programs released that allowed you to extend the functionality of batch files there was never such a market for batch extenders for OS/2 although a few popped up. This is mainly due to the presence of REXX as a component of the OS, but since that is a fully fledged programing language, albeit one that is unusually easy to use, you can do literally create the functions you might want from REXX rather than go looking for a third party utility.

OS/2 Batch file commands

  • CALL
  • ECHO
  • ENDLOCAL
  • EXTPROC
  • FOR
  • GOTO
  • IF
  • PAUSE
  • REM
  • SETLOCAL
  • SHIFT

In addition the above commands a batch script can call any valid OS/2 program including normal executables, scripts in other languages and system commands. Most batch commands have formatting and options more like a executable than what you would expect from a scripting language. Some batch file commands can also be used from the command line but have limited utility there.

OS/2 text & programmers editors with OS/2 batch file support

DOS text & programmers editors with OS/2 batch file support

DOS Batch file commands

  • @
  • %?
  • %?%
  • CALL
  • ECHO
  • FOR
  • GOTO
  • IF
  • PAUSE
  • REM
  • SET
  • SHIFT

OS/2 text & programmers editors with DOS batch file support

DOS text & programmers editors with DOS batch file support

Links