KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Printing text files using Launch External Process on Windows
PRODUCT: 4D | VERSION: 2004 | PLATFORM: Win
Published On: April 30, 2008

There are three different ways to print text files using the LAUNCH EXTERNAL PROCESS command. The DOS commands PRINT, COPY, and TYPE can all be used to print text files.

The following three examples will all print the contents of the myFile.txt file to the printer on port LPT1:

With the PRINT command:

$myCommand:="PRINT C:\\myFile.txt /d:LPT1:"
LAUNCH EXTERNAL PROCESS($myCommand;$input;$output)



With the COPY command:

$myCommand:="COPY C:\\myFile.txt LPT1:"
LAUNCH EXTERNAL PROCESS($myCommand;$input;$output)



With the TYPE command:

$myCommand:="TYPE C:\\myFile.txt > LPT1:"
LAUNCH EXTERNAL PROCESS($myCommand;$input;$output)