Switching the printer port
If the server of the IQ4docs system stops processing print jobs, for example, because it is no longer functioning correctly due to a malfunction or cannot be reached due to network problems, the print port of the printer queues can be switched directly to the devices.

To use this function, there must be a separate printer queue on the server for each device (shared queue) whose connection is directed to the IQ4docs system's server. A script can be used to direct the printer queue ports directly to the device. If the required connection is not available, it is generated automatically, see also Printer configuration file (SpoolerPortSwitcher.txt). Which queue is changed must be specified in the data record of the device, see Add devices.

The printer configuration file (SpoolerPortSwitcher.txt by default) contains queue and printer port information. The file has the following structure:
Spoolername;hostname;portname(optional, default = [hostname]_9100);
"Printer 1"; "192.168.3.52”;
"Printer 2"; "192.168.3.58”;
"Printer 3"; "192.168.3.41”;
...
Parameters | Description |
---|---|
Spooler name | The name of the printer queue that is responsible for the device is entered here, i.e. whose port is switched. |
Hostname | The hostname for connecting the printer queue. |
Port name | Optionally, the name of the printer port can be entered here. This name is used if the required connection is not available and is generated automatically. If the port name is not explicitly specified, <hostname>_9100 is used by default. |

This function is executed by the application PortSwitcher.exe, which is independent of the IQ4docs system. This is carried out by two pre-configured batch files. You will find the files described below in the PortSwitcher subdirectory of the installation path for the IQ4docs server.
- ToServer.bat (Switches the printer port back to the IQ4docs server.)
- ToPrinter.bat (Switches the printer port back to the devices.)
The call line (which can also be executed directly in a command prompt or included in another batch) is, for example, for switching to the server:
-
PortSwitcher.exe -file SpoolerPortSwitcher.txt -server -port 127.0.0.1
Parameters | Description |
---|---|
PortSwitcher.exe | Name of the program to which the following parameters are passed. |
-file SpoolerPortSwitcher.txt | The -file parameter is used to transfer the printer configuration file with device specifications separated by a whitespace, see Printer configuration file (SpoolerPortSwitcher.txt). |
-server or -printer | The parameters -server and -printer cannot be used simultaneously. With -printer, the connections are switched so that they lead directly to the device. With -server, the direction is switched back to the IQ4docs server (connection then leads back to the KYOcontrol server). |
-port 127.0.0.1 | The -port parameter after a whitespace specifies the port name of the port leading to the IQ4docs server (not the printer name or IP address). |