! (Shell Escape)

Syntax

![[[[!]]command]]

Parameter

command

Executes the given program or operating-system command without leaving CodeView. Use the second exclamation point to return to CodeView immediately after completing command.

Description

The Shell Escape (!) command (CV only) allows you to exit from the CodeView debugger to an MS-DOS shell. You can execute MS-DOS commands or programs from within the debugger, or you can exit from CodeView to MS-DOS while retaining your current debugging context.

If you want to exit to MS-DOS and execute several commands or programs, enter the Shell Escape command with no arguments (!). After the MS-DOS screen appears, you can run internal system commands or programs. When you are ready to return to CodeView, type the command exit (in any combination of uppercase and lowercase letters). The debugging screen appears with the same status it had when you left it.

If you want to execute a program or an internal system command from within CodeView, enter the Shell Escape command followed by the name of the command or program you want to execute, as in:

!command

The output screen appears, and CodeView executes the command or program. When the output from the command or program is finished, the message

Press any key to continue...

appears at the bottom of the screen. Press a key to make the debugging screen reappear with the same status it had when you left it. To suppress this prompt and return directly to CodeView after the command is executed, use two exclamation points (!!) for the Shell Escape command.

The Shell Escape command works by executing a second copy of COMMAND.COM.

Mouse and Keyboard

In addition to typing the ! command, you can also invoke a command shell from the File menu.

Remarks

Opening a shell requires a significant amount of free memory since the following are all resident in memory:

CodeView

The debugging information

The system's command processor

The program being debugged

If your machine does not have enough memory, an error message appears. Even if there is enough memory to start a new shell, there may not be enough memory left to execute large programs from the shell.

In order for you to use the Shell Escape commands, the executable file being debugged must release unneeded memory. Programs created with Microsoft compilers release memory during startup.

Side effects of commands executed while in a shell, such as a change in the working directory, may not be seen when you return to CodeView.

Example

In the following example, the shell command DIR is executed with the argument A:*.OBJ. The directory listing will be followed by the prompt that asks you to press any key:

!DIR A:*.OBJ

In the following example, the COPY command is executed and control returns to CodeView. No prompt appears.

!!copy output.txt d:\backup