Executes a DOS command or another program within a separate DOS window.
string Any executable command as it would appear on the DOS command line.
MINIMIZED Forces Procomm Plus to execute the command or program as a minimized icon.
MAXIMIZED Executes the command or program in a full-screen DOS window.
HIDDEN Forces Procomm Plus to execute the command or program with no visible DOS window.
intvar An optional integer variable assigned the task id number of the DOS window. This task id can be used in the taskactivate, taskexit, ddeinit and other commands.
Example
proc main
string Cmd ; DOS command to execute.
Cmd = "dir *.* > temp.fil" ; Set DOS command to execute.
DOS Cmd HIDDEN ; Run DOS command hidden.
; This is an easy way to get a list of files from a
; directory into a file. If you're using DOS 5.0
; or greater, you can specify the /B option to get
; a cleaner listing.
endproc
Comments
If one of the optional parameters MINIMIZED, MAXIMIZED or HIDDEN is not used, the application runs using a default window size and position.
The dos command is equivalent to using the Run command in the Windows File Manager with the string "COMMAND /C cmndname" as an argument. The DOS session uses the settings in _default.pif, unless a .pif file already exists for command.com.
If the path to the executable command is not specified, the program or external DOS command must be either in the current directory or in the directory specified in your DOS path. ASPECT will, however, change to the directory specified in $USERPATH before attempting to execute the dos command. Also, command.com must be in the directory from which you started your computer, typically the root directory of drive C or in the location specified by the COMSPEC environment variable.
dos can be tested with the if SUCCESS statement, returning false if command.com is not found or true if it is found, even if the command to be executed is invalid or fails to execute. The run command provides a similar function and provides better testing for DOS external commands and other programs.
If you use the dos command to execute a program or command that requires user input, be sure that the user is aware of this, since processing will halt until the required input is provided. The dos command will execute both standard DOS batch files and internal DOS commands. The run command only accepts .com and .exe programs. Under Windows Standard mode, a DOS session will run full screen.
See also
run, shell and taskexists; DOS- or Disk-Related Commands.