Ghostscript, Redmon and Windows NT


Table of Contents

  1. Why does the Print Setup dialog appear when I print to the Postscript printer?
  2. How do I disable the Cancel dialog box?

Why does the Print Setup dialog appear when I print to the Postscript printer?

This dialog does not appear if you print from the command-line:

%GS_LIB%\gswin32c -dNOPAUSE -I%GS_LIB%;%GS_LIB%\fonts -sDEVICE=mswinpr2 -sOutputFile="\\spool\label" -

The dialog does appear if you put the same code into the RPT1 Port Configuration dialog box. The reason is the code in the mswinpr2 print driver tries to find the printer specified in the -sOutputFile option (without the \\spool\). However, when the spooler runs under the SYSTEM account which has different registry settings, the code in mswinpr2 uses the Win32 GetProfileString to get the entire [Devices] in win.ini. Under Windows NT 4.0, this section is mapped to the user profile.

REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\win.ini]
"Devices"="USR:Software\\Microsoft\\Windows NT\\CurrentVersion\\Devices"
"PrinterPorts"="USR:Software\\Microsoft\\Windows NT\\CurrentVersion\\PrinterPorts"

On my machine, the administrator account has this in the registry.

REGEDIT4
[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Devices]
"Brother PTouchPC PS"="winspool,RPT1:"
"label"="winspool,FILE:"

When gswin32c runs under the system account, the above devices are missing and the mswinpr2 driver thinks the devices do not exist. To allow it to find the driver, add the following registry setting to the default user registry.

REGEDIT4
[HKEY_USERS\.DEFAULT\Software\Microsoft\Windows NT\CurrentVersion\Devices]
"label"="winspool,FILE:"

This information was contributed by muirp at fibersoft.com.

Back to Top


How do I disable the Cancel dialog box?

When using the mswinpr2 device with RedMon, a "Cancel" dialog box is displayed showing progress. To disable the "Cancel" dialog box, add -dNoCancel to the Ghostscript command line..

Back to Top