Results 1 to 2 of 2

Thread: Changing Captured Printer Queues in VB.Net

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2003
    Location
    Corn Country, Illinois
    Posts
    1

    Changing Captured Printer Queues in VB.Net

    Currently I use a simple VBScript to change the captured printer queues for an LPT port on my NetWare workstations to different remote printer queues. Here's the code I use:
    Code:
    [VBScript]
    Set WshNetwork = WScript.CreateObject("WScript.Network")
    WshNetwork.RemovePrinterConnection "LPT2", true
    WshNetwork.AddPrinterConnection "LPT2", "\\ServerName\PrintQueueName"
    It's quick, simple and about 10 times faster than NetWare's built-in CAPTURE program. It uses no NetWare-specific functions, just plain old printer port captures to a network printer queue. All workstations that use these scripts already have LPT2 captured to a NetWare queue.

    Unfortunately, VBScript doesn't allow much of an elegant interface to select the different printer queues. At the moment, I'm stuck with a folder with different .VBS scripts for each printer that I want to use.

    I've created the new, slick interface with VB.Net (my 5th program so far) but unfortunately, I can't figure out the print capture routines. Now, the $64,000 question:

    Is there any way I can adapt this simple funtion (remove current printer connection on an LPT Port then add a new connection to another printer) to use it in VB.Net? The only samples of anything like this I've seen require about 100 lines of code that I don't understand at all yet. Am I going to have to muddle through the Windows API or maybe learn the Novell VBasic SDK to be able to do this?

    Thanks for any ideas.

  2. #2
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616
    You're going to have to muddle through some API - GetPrinter and SetPrinter calls seem favourable?
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

Posting Permissions

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



Click Here to Expand Forum to Full Width