Results 1 to 3 of 3
  1. #1
    StormyWaters is offline Senior Member
    Join Date
    Feb 2009
    Posts
    305
    Rep Power
    6

    Default Calling Shell Command against COM or LPT Ports and/or communicating to these Ports

    Hello all,

    I've been trying all morning to figure out how to send information from a Windows Environment to a printer I have connected on a Serial Port or Parallel Port. I was having a hard time finding any programming approach for doing this, but I did notice that if I do a "copy file LPT1" from the command line, it would print. I decided to try and use this approach for the printing, however, whenever I call it from the Java Program, with the following message:

    The system cannot find the file specified.
    0 file(s) copied.

    Is there any way I could call this from Java without getting the error? I discovered if I change the "LPT1" to a File Path, it will copy the original file to the new File, so this leads me to believe it has something to do with trying to send it to the Parallel Port. If there is an inherit problem with this, has anybody ever done any Serial or Parallel communication in Java before? I am having a real hard time finding anything on this.


    Any help would be appreciated,
    Thanks

  2. #2
    VanGo is offline Member
    Join Date
    Apr 2009
    Posts
    12
    Rep Power
    0

    Default Re: Calling Shell Command against COM or LPT Ports and/or communicating to these Port

    Not sure if this will work for you.
    But when I need to use the serial port I have installed Serproxy which is a proxy server.
    Then connect to the socket with Java.

  3. #3
    StormyWaters is offline Senior Member
    Join Date
    Feb 2009
    Posts
    305
    Rep Power
    6

    Default Re: Calling Shell Command against COM or LPT Ports and/or communicating to these Port

    Thanks, I'll take a look at that. I've been thinking of trying to do some JNI to see if I can get this to work, as I've never really had experience doing it and this seems like it should be a good opportunity to learn it. The socket seems to be an easier solution though :)

Similar Threads

  1. Ports
    By dougie1809 in forum Networking
    Replies: 2
    Last Post: 02-17-2012, 10:15 PM
  2. Socket's ports
    By Rose88 in forum Networking
    Replies: 5
    Last Post: 05-31-2010, 09:21 PM
  3. opening ports
    By prashant in forum Networking
    Replies: 2
    Last Post: 03-22-2009, 08:23 PM
  4. Looking for servers on ports
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-13-2007, 09:28 AM
  5. How to know the ports opened by JVM
    By sandeepspatil in forum Advanced Java
    Replies: 1
    Last Post: 08-02-2007, 01:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •