USB printer>LPT1 via netUse WITHOUT connection

fhano Posted messages 31 Status Member -  
fhano Posted messages 31 Status Member -
Hello,

Under XP Pro
I connected a USB printer to a PC, but a DOS program needs to use LPT1: to send its prints.

I connected this PC via Wi-Fi with a fixed IP and shared the printer with the name "HP1230".
Then I used

Net use /persistent:yes LPT1: \\192.168.1.2/HP1230

It works perfectly, except that... This computer absolutely cannot have any input or output on any network. But as soon as I disconnect from the network, this system does not work anymore. So I cannot use this method.

I then tried the same command while disconnected and replacing the IP with the computer name, but I systematically get an error message (error 5xxx or something like that). (I specify that the method with the IP works systematically, as long as I am connected).

How can I simulate this LPT1: on a computer without any connection?

Another lead, in the worst case, how can I prevent any access to this computer, whether internet or network, while maintaining this connection status that allows me to have my "subterfuge" printer always functioning?
Configuration: Mac OS X Safari 531.21.10

20 answers

  1. fhano Posted messages 31 Status Member 10
     
    Everything is now working perfectly!

    Summary of the problem for those looking for a solution to a similar issue:
    I had a business program, under DOS, that only prints to an LPT1 printer port, installed on a PC that cannot be connected to any network, has no parallel port, and no possibility of expansion (all-in-one screen), on which I had to connect and get a USB printer working.

    So, I will summarize what worked and what didn't in this issue.

    The solution was to install Microsoft's "loopback adapter" and use this method: http://www.megatech-informatique.com/Information/Imprimer_en_DOS.htm

    Once everything was set up correctly, I just had to share the printer (properties-share-set a short name of max 8 letters) and execute the DOS command:

    Net use /persistent:yes LPT1: \\127.0.0.1/HP1230

    It now works wonderfully.

    The printer is just slower under DOS than when printing directly from a Windows program; there might be a few seconds before getting a response.

    Methods that did not work:
    - I tried checking the "printer pooling" option and "LPT1" in the printer properties but under DOS XP, nothing comes out on LPT1:
    - I bought a USB>LPT cable and installed its management program, but it creates a "USB001" port
    - I deleted "LPT1:" from the Windows registry and renamed "USB001" to "LPT1", but that also didn't work.

    A big thank you to all the contributors: as often happens, I was missing a "small" something that I was stuck on, and thanks to you, I found the solution! BravoOo ;-)
    2
  2. sorcierblanc Posted messages 3192 Registration date   Status Member Last intervention   462
     
    Still there?
    0
  3. Anonymous user
     
    If you have a printer set up on your PC, you might want to try something:
    In the printer properties, under the "Ports" tab, check the box at the bottom "Enable printer pooling" and there you can also check the LPT1 box (in addition to the one already checked).
    --
    Hi guys, kisses to the girls,
    Pierre
    0
  4. fhano Posted messages 31 Status Member 10
     
    Hello,

    Firstly, I deleted my LPT1: alias with net use /delete and then I tried through the pool by adding LPT1. It is indeed checked alongside the printer's base port. But when I send a print job from the troublesome DOS program, the printer doesn’t output anything, sadly. I restart my LPT1 alias with net use and it works again.

    I’m going to try another option: I ordered a USB to LPT cable, but I hope we can configure the printer as LPT1 with this type of cable and that it won’t instead be recognized as a USB printing port.

    Has anyone already tested this type of cable? I personally had some issues with a USB to Serial cable where it was never possible to configure the COM port correctly.
    0
  5. Anonymous user
     
    USB to ...
    It depends on the end connected to the PC.
    If you connect a serial port from your PC to a USB on a printer,
    you can use the serial port of the PC (otherwise, obviously, it would play a trick on you) ;-)
    If you connect the parallel port of the PC to a USB port of the printer, you can
    use LPT1 of the PC.

    Conversely, a cable that allows you to connect a serial port (from a printer) or
    a parallel port (from a printer) to a USB port of the PC can only be used
    on the PC with a USB port driver.
    --
    Hi guys, kisses to the girls,
    Pierre
    0
  6. fhano Posted messages 31 Status Member 10
     
    I suspected it would be this way since the controller integrated into these cables is obviously first and foremost "USB". I just hope it will come with software that emulates an LPT like some USB to SERIAL cables that emulate a COM serial port.
    0
  7. sorcierblanc Posted messages 3192 Registration date   Status Member Last intervention   462
     
    Have you tried DosBox, which allows you to run DOS while being in Windows, thus enabling you to use old DOS software with XP for example? Maybe the USB output of Windows will work directly for printing? I don't know, I haven't tried printing, but all the software works very well.
    0
  8. fhano Posted messages 31 Status Member 10
     
    Since this is a company network, they do not want a third-party program or emulation. I also considered emulation programs like Parallels Desktop on Mac, but they do not want that.
    0
  9. sorcierblanc Posted messages 3192 Registration date   Status Member Last intervention   462
     
    There are also USB-parallel and parallel-USB printer cables.
    0
  10. fhano Posted messages 31 Status Member 10
     
    Yes white wizard, that's what I wrote earlier, but the problem is whether this cable reacts like a USB port or like a LPT1 port. In my opinion, the cable will be recognized as a USB interface and not as a parallel port. I ordered one to try it out. It would be perfect if it came with an LPT emulation driver. I've already bought USB>serial cables and they were delivered with software emulating COM5, 6, and 7 ports on a PC that already has 4 original COM ports.
    0
  11. sorcierblanc Posted messages 3192 Registration date   Status Member Last intervention   462
     
    There are also PCI controller cards that can be plugged into a PCI port and provide LPT1 and COM1 and COM2 ports at the back, so no more problems. And they're cheap, too.
    0
  12. sorcierblanc Posted messages 3192 Registration date   Status Member Last intervention   462
     
    Look at this as an example (PCI, but exists in PCI-express)

    http://www.ldlc.com/fiche/PB00077617.html

    A+
    0
    1. fhano Posted messages 31 Status Member 10
       
      Too bad: I have this type of interface on the server, but for the office PCs, they are screens with the PC integrated (iMac version PC).
      0
  13. Anonymous user
     
    Are you mistaken??
    The problem is that you have an application on the PC using LPT1 in DOS.
    Whatever you connect via PCI won't change anything.
    The ports you’re talking about are for connecting equipment that has a
    serial or parallel connector to a PC that doesn’t have that connector.
    You need to find a piece of software that can intercept the LPT1 port and send it
    somewhere else. There may be a solution by redirecting the program's output to a file
    and then printing that file, but you have to take into account the control characters
    of the printer.
    --
    Hi to the guys, kisses to the girls,
    Pierre
    0
  14. fhano Posted messages 31 Status Member 10
     
    I just received the cable and as I was already 95% convinced, it does indeed provide a port "USB001" and not "LPT". But this cable gave me another idea, but I need to test it: if I delete "LPT1" from the registry in the NT section. The installation program that comes with the cable creates an entry to create its "USB001". I'm going to rename it "LPT1" and keep my fingers crossed. I know it's a bit far-fetched, but nothing ventured, nothing gained. In any case, at worst, we can revert to the previous backup ;)
    0
  15. Anonymous user
     
    Hello

    I just found this on the Internet:

    http://www.megatech-informatique.com/Information/Imprimer_en_DOS.htm

    I tried it: it didn't work before, but now it does. It's great like a truck.

    1°) Define the normal printer as shared with a short DOS name (8 characters max in uppercase).
    2°) Run the command NET USE LPT1: \\127.0.0.1\shortname /PERSISTENT:YES
    That's it.
    --
    Hi guys, kisses to the girls,
    Pierre
    0
  16. fhano Posted messages 31 Status Member 10
     
    In fact, that’s exactly what I tried first, but since my 127.0.0.1 wasn’t working, I used my command “Net use /persitent:yes LPT1: \\192.168.1.2/HP1230”.

    But thanks to the explanation on the link http://www.hobbek.com/Megatech/­_DOS.htm, it seems that I was missing an element for it to work internally with 127.0.0.1

    I will try again and keep you updated.

    In any case, a really big thank you for your help.

    P.S.: I’m not giving up on the idea of changing the name in the registry that I had thought about (if only out of curiosity).
    0
  17. Anonymous user
     
    For 127.0.0.1, you need to have a line in the "hosts" file.
    It's a file located in C:\WINDOWS\system32\drivers\etc
    It's simply called hosts, and you need to open it with Notepad.
    It should contain a line with: 127.0.0.1 localhost
    the "1" in 127 being in column 1. In the TCPIP properties
    for your network card, advanced, WINS tab, you also need to check
    the LMHOSTS lookup.
    --
    Hi guys, kisses to the girls,
    Pierre
    0
  18. Anonymous user
     
    Thank you for this summary of your manipulations to achieve the result.
    Just that it should be \HP1230 (and not /HP1230).
    The startup delay must be the "network" delay because
    it is a NET command.
    Keep up the good work.
    --
    Hi to the guys, kisses to the girls,
    Pierre
    0
  19. fhano Posted messages 31 Status Member 10
     
    yes sorry for the backslash that's correct ;)
    0