No announcement yet.

Windows Vista LPRINT ATTACH to UNC share name

  • Filter
  • Time
  • Show
Clear All
new posts

  • Windows Vista LPRINT ATTACH to UNC share name

    For some reason, when you use LPRINT ATTACH to connect to a UNC printer share, an error 68 is generated. This only occurs when the machine sharing the printer is running Vista.

    Tests Completed Thus Far:

    1. I have tested Vista with UAC turned OFF (see TweakUAC & msconfig/tools/disable UAC)
    2. I have used the command line to enable the Vista administrator account and then logged in as the administrator (NET USE Administrator /active:yes ) and then tested the LPRINT ATTACH
    3. I've run the PowerBASIC code "as administrator"
    4. I've tested this issue on Vista Home Basic, Home Premium and Business editions.

    On all versions of Windows LPRINT ATTACH works perfectly provided that the machine hosting/sharing the printer is not a Vista machine.

    Please do not post back "you should use XPRINT". We need to send a complex series of binary escape codes to control industry specific equipment. It is not possible to use XPRINT to accomplish this. Because LPRINT creates a downlevel print job, it is the only solution I've found in PowerBASIC.

    If anyone has ANY IDEAS (calling DLLs, Assembly code, etc etc) please post your thoughts.

    If you are a super guru and have any ideas what Vista is doing differently from XP, please feel free to share your thoughts. My best guess is that the compiled code produced by PowerBASIC is not running under the proper escalation level. This may be a bug in Windows Vista or it may be an issue that a M$ patch is available for. Perhaps some inline assembly code could make the Vista O/S accept an LPRINT ATTACH?

    Thank you so much in advance for any help.


  • #2
    I will make two guesses....

    1. If it is a permissions, can't you use a manifest in your program to specify the "level" of access?


    2. It possible the Vista o/s does not use the same naming convention for shared printers?
    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]


    • #3
      i have to do something like this also

      I create a file with all of the escape codes and commands and just copy to the printer share which bypasses the printer driver


      • #4
        Have you ever tried the COPY to a UNC printer share on Vista? If so, do you have a code sample.

        I have tried using a manifest file already - sorry, forgot to mention that.



        • #5
          Error 68 - Device unavailable
          Device unavailable - (%ERR_DEVICEUNAVAILABLE) - You tried to a device or to a device or graphic without that device present or installed.
          For example, opening COM1 on a system without a serial adapter or modem, or attempting to use TCP/IP or UDP/IP on a machine without Winsock 2.0 (or better) installed. Also, trying to attach to a graphic or printer that is not available will cause this error.
          You sure that printer is defined correctly on this Vista system?

          Show LPRINT ATTACH code.

          Or maybe its as simple as first doing something like
          IF Vista
                NET USE lpt1:  = sharename  (shell, createprocess, NetFunction, whatever) 
                LPRINT ATTACH Lpt1 
               current working code. 
          END IF
          Hell, it's a thought.

          Michael Mattias
          Tal Systems (retired)
          Port Washington WI USA
          [email protected]


          • #6
            share the printer so that others can print to it

            then file copy \\computer name\Share name

            I do it all the time on a 2k netowrk
            I do not have vista yet



            • #7
              Problem Solved - VISTA LPRINT ATTACH UNC

              Thank you! Thank you! Thank you!
              Got it to work using FILECOPY.