Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm pretty new to Microsoft Servers so don't blame me if the question isn't that smart [I'm a Unix guy].

I need to install a Virtual Printer of a Microsoft Server 2008 r2. The requirements are:

  • The printer must print on a file {whatever file... txt or pdf }
  • The printer must run on a server
  • The printer must accept plaintext from a specific IP:port
  • The connection between the device that prints and the server is a local network

The device that is supposed to print, is a professional device, a PSTN receiver, and it prints simply sending from the port 1027 to the GatewayIP the message {everytime negotiating a new port on the stream output receiver (i.e. the server that receives the data)) ...

I've tried to install a virtual printer, but I cannot specify the constraint about the socket from which receive data to print.

Thank you so much

share|improve this question
I have the impression you are looking at this from a wrong angle. It sounds like what you want to do is to capture plaintext you receive on a specific port into a file, is this right? – Sven Mar 19 '12 at 9:45
exactly... by the way the point is that since I'm working with a pstn call receiver, I need this virtual printer in order to print status messages of the receiver... kinda log basically. Is it clearer? – MixturaDementiae Mar 19 '12 at 10:14
Yes, but you should edit your question accordingly, eliminate the term printer etc., to allow people to make recommendations based on the actual problem, who might otherwise skip the question if they read the term printer in the title. – Sven Mar 19 '12 at 10:26
The whole "virtual printer" idea is probably getting you nowhere, especially since the "must accept plaintext from a specific IP:port" is simply not something a printer, virtual or not, is designed to do. You should be more detailed about the protocol to see if other possibilities exist. How exactly is the destination port negotiated? – the-wabbit Mar 20 '12 at 9:33
Well you are right and I feel sorry for not being clear but the point is that the protocol is proprietary, I only know the IP and port, anyway I've solved it just installing a tool as showed by @gravyface ;) – MixturaDementiae Mar 20 '12 at 19:55
up vote 0 down vote accepted

I don't think you need a printer at all. If the device is sending plain text to (I'm assuming) TCP <some_ip_address>:1027, then anything from netcat to a custom listener/parser that understands the message format (i.e. knows when a message starts and ends) is what you need.

The former would be trivial to set up, but would require post-processing/parsing, the latter, well, I would do a bit more homework and find out from the vendor where/what the proper solution is here; surely you're not the only one who owns one of these PSTN devices.

share|improve this answer
The point is that the device that is supposed to print, is a professional device, a PSTN receiver, and it prints simply sending on the GatewayIP and Port 1027 the message... so in this way the virtual printer would not be able to capture the packets and then redirect them as output on a file... – MixturaDementiae Mar 19 '12 at 10:40
So you can't install a shared printer locally on your device is what you're saying. You should make that clear in the question. – gravyface Mar 19 '12 at 10:44

If you simply want logging to a text file from a TCP socket, you surely do not need a "virtual printer". Consider using netcat which also exists as a Windows port instead. Simply creating a listener and redirecting to a text file of your choice should do the trick:

  nc -l 1027 >> c:\pstnlog.txt
share|improve this answer
You'd think a UNIX guy would surely know about netcat... – gravyface Mar 19 '12 at 11:17
@gravyface probably only as long as he is not thinking about virtual printers :) – the-wabbit Mar 19 '12 at 12:16
well I wasn't clear sorry, it send from the port 1027 to the port xxxx, so everytime changes the port... :| – MixturaDementiae Mar 19 '12 at 12:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.