Execute

Prev Next Home Home Table Of Contents Index

Execute ("command string")

This allows you to execute a program without dropping out of MarxMenu. MarxMenu remains resident in memory and takes up approximately 100k. No batch file will be created by MarxMenu.

This is handy if you have a small program you want to run from the menu but don't want to allow for the time required by MarxMenu to create and run a batch file. You can also execute some programs in a MarxMenu window (See Also: DosWindow). You can also execute a program and examine the return code.

This command can be placed in a progression of menu commands without any special handling. Under an OnKey statement, you will need use a vertical bar in front of the command.


Example:
OnKey 'D' |UseCommand Off |Execute 'C:\DM.COM' ;Note the COM extension is required here.

Note: If UseCommand is True or On, MarxMenu will load COMMAND.COM to execute your command. If UseCommand is False, MarxMenu will execute your file directly without COMMAND.COM. Using COMMAND.COM will execute slightly slower, use 3.5k more RAM, and allow you to use command lines just like you would from the DOS prompt.

If you set UseCommand to Off, you will have to include the COM or EXE extension in the name. If you don't include the extension, MarxMenu will automatically override UseCommand and load the command processor. If the command processor is loaded then you won't be able to read the errorlevel return code from the program you are running.

MarxMenu will also use COMMAND.COM if you are piping or redirecting output to a file. COMMAND.COM is required when running internal DOS commands like COPY or DIR. It is also required to run batch files.

When UseCommand is off, MarxMenu will search the PATH for the executable file if it isn't in the current directory.

Not using COMMAND.COM allows you to use the ReturnCode variable to get the ERRORLEVEL from the subprogram. If COMMAND.COM is loaded, the ERRORLEVEL of the subprogram is lost.

The ClearScreenFirst (On/Off) controls whether MarxMenu will clear the screen before you execute.

The PauseAfterExecute (On/Off) allows you to have a pause like the Pause command in batch files. That way you can read the screen before it restores the MarxMenu screen. MarxMenu will display "Press any key to return to MarxMenu."

By setting DosWindow to true MarxMenu will allow some programs to execute with the display going to a MarxMenu window. For this to work the program must output it's text to the standard output device. Programs that write directly to the screen won't work with DosWindow.

When Swapping is set to On, MarxMenu will swap itself out to EMS, XMS or disk reducing it's memory footprint to about 5k of ram. If MarxMenu uses a disk file, the file name is the same as the temporary batch file name with the extension SWP.

Be sure not to load any TSR programs using the Execute command or MarxMenu will lock up.

See Also: UseCommand DosWindow PauseAfterExecute ClearScreenFirst
Swapping ReturnCode

Category: Execution

Prev Next Home Home Table Of Contents Index

Sponsors
Shopping
Forum
Forum
email
EMail
Index
Index
Home
Home