mov bx, ListIndex ;assign-list index
mov cx, SetupSize ;length of setup string
mov dx, seg SetupString
mov ds, dx
mov dx, offset SetupString ;ds:dx points to printer setup string
mov ax, 5E02h ;Set Printer Setup
int 21h
jc error_handler ;carry set means error
Set Printer Setup (Function 5E02h) defines a string of control characters that MS-DOS adds to the beginning of each file sent to a network printer.
ListIndex
Specifies the assign-list index for a network printer.
SetupSize
Specifies the length of the string that will be sent to a network printer. The setup string cannot be longer than 64 characters.
SetupString
Points to a buffer that contains the string to be sent to a network printer.
If the function is successful, the carry flag is clear. Otherwise, the carry flag is set and the AX register contains an error value, which may be 0001h (ERROR_INVALID_FUNCTION).
This function returns 0001h (ERROR_INVALID_FUNCTION) if the network is not running.
Function 5E03h Get Printer Setup
Function 5F02h Get Assign-List Entry