Home Forums HTBasic Forum HTBasic 2021 LPT printer Reply To: HTBasic 2021 LPT printer

#9313
Ralph Wilson
Keymaster

    Hi Bert,

    There are two things that you may need to do to fix this.

    First, if you are accessing a network printer, you need to map it to lpt1 with NET USE. If the printer is on another computer, you will need the password of a user on that computer so that you have permission to execute this as follows:

    NET USE LPT1: \\computer_name\printer_name /PERSISTENT:YES /USER:userid thePassword

    This user does not have to be logged in, but simply exist.

    Second, since you are now on a new computer/OS, the default setting for the printer may need to be changed in Properties/Advanced with the option “Print directly to the printer” vs “Spool print documents…”.

    If you are still having problems with these settings, a possible workaround is the following:

    In your program, direct your output to a file instead of lpt1 (ISC 26). Then, when you are ready to print the file, use:

    EXECUTE "start /min notepad /p "&Path$&File$ ! where Path$ is the folder path to your file and File$ is the name of the file

    Alternately, if you are actually printing to lpt1, you could try:

    EXECUTE "print /d:lpt1 "&Path$&File$ ! since lpt1 is the default, you can omit /d:lpt1

    Or, if printing to a network printer named “printer1” on a computer named “copyroom”:

    EXECUTE "print /d:\\copyroom\printer1 "&Path$&File$

    Note: In the above examples, a command line window is opened by EXECUTE that you will have to manually close.

    Let us know if any of this helps.

    Ralph

    Scroll to Top
    HTB icon

    Please Sign In