|
-
Nov 7th, 2003, 06:21 PM
#1
Thread Starter
New Member
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.
-
Nov 8th, 2003, 06:45 AM
#2
Frenzied Member
You're going to have to muddle through some API - GetPrinter and SetPrinter calls seem favourable?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|