Macro Language Reference > Macros > Application > !
  
!
Description
Shells out of PTC ALD to DOS. This command can be run in two ways:
! : shell out to DOS
! ! : carry out a DOS command and return you to PTC ALD
 
Before running the shell macro, you may need to configure PTC ALD to allow more memory to other programs.
 
Example 9. Combine shelling out to DOS and the redraw macro
On a single-monitor system you can enclose the shell command within brackets and follow it with a wdr macro to redraw 's screen once the command has been carried out:
( ! ! dir):wdr
 
Example 10. Shell out to create a new directory
The macro below will create a new directory:
! ! md c:\temp\chris_temp
 
Example 11. 'Echo' text to an ASCII text file
Another use for the shell macro in this form can be to 'echo' text to an ASCII text file. This could be useful if you need to keep track of, for instance, the time spent on a particular project and need to keep a record of your hours; or, more ambitiously, to send data from a script to a database or billing system.
The first macro shown below opens a new text file with the words 'WORK RECORD' on line 1. Note that any file of the same name will be overwritten:
!! echo WORK RECORD >c:/3d/mytime.txt
You could then add details, using the DOS echo command with two >> characters:
!! echo Corrections to text file, 5hrs >>c:/3d/mytime.txt
The text file would now contain two lines as shown below:
WORK RECORD
Corrections to text file, 5hrs
 
Example 12. Shell out to run an external program
The example below will run MS OUTLOOK when executed:
!!start "" "C:\Program files\Microsoft Office\Office\
OUTLOOK.EXE"
In a simplified version, this macro will run Word Perfect when executed:
! wp
 
Example 13. Produce a directory listing using DOS redirection filters
The macro below would produce a directory listing in the file list.txt using DOS redirection filters.
!! dir >list.txt
Syntax
! command:b?
command
The DOS command to be run when you shell out of PTC ALD . If you do not specify a command the message Type 'exit' to return to PTC ALD will be displayed over the command-line prompt when you shell out to DOS. If a command has been specified the message Press any key to return to PTC ALD will be displayed on your screen after it has been executed.
Additional Information
* 
You should never attempt to restart PTC ALD when shelled out of the program. Doing so will probably cause your system to hang. You could try including an exit command at the start of your 3b2.bat file if you find that you are frequently trying to restart whilst shelled out; this should not have any effect when you are not shelled out.