Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connect Network-Printer

Status
Not open for further replies.

NIEDAX

Programmer
Mar 24, 2005
7
DE
Hi,

we have Clipper5.2e and use novlib to capture the Novell-Queue., but novlib uses only IPX. We want to use IP, so we test it with swpruncmd("net use lpt3 \\server\queue",0,"",""). It dosn't func everytime! We test lanman on Win98 and it func great, but not under WinXP :-(
We search for a "net use" and "capture" function that funcs on WinXP and over IP.

Olli
 
Olli

Unfortunately, XP will not let you capture a printer port that doesn't exist (it is unlikely that you have a 'real' lpt3).

You have to capture a port that is physically available.

So:
Code:
swpruncmd("net use lpt1 \\server\queue",0,"","")

Will generally work.

TIP
If you need to capture to a Jet Direct card, or similar network connected printer, using an IP address - the easiest way to do this is to set it up as a printer on another machine - then share that - then capture to the share!



Regards

Griff
Keep [Smile]ing
 
Hi Griff,

the swpruncmd dosn't work everytime! I would have a function for Clipper where I can capture it. And when I use "net use" on a Win98-Client for captureing a Novell-Queue, the Banner is printing (Banner isn't activatet in the Novell-Client). A newer Version from novlib or lanman would be perfect! But I didn't find a newer Version :-(

Regards

Olli
 
There is no reason why it shouldn't work every time - barring the physical port thing.

This is the code I use


Code:
FUNCTION CAPTURE_PRN
  PRIVATE MSTRING
  IF SYS_CAPTURE=YES
    IF SYS_LPT <> "PORT"
      MSTRING = "NET USE "
      MSTRING = MSTRING + SYS_LPT+" "+ALLTRIM(SYS_QUEUE)+" /DELETE "
      SWPRUNCMD(MSTRING)
      MSTRING = "NET USE "
      IF SYS_PERSIST = YES
        MSTRING = MSTRING + "/PERSISTENT:YES "
      ENDIF
      MSTRING = MSTRING + SYS_LPT+" "+ALLTRIM(SYS_QUEUE)+" "
      IF !EMPTY(SYS_USERNAM)
        MSTRING = MSTRING + "/USER:"+ALLTRIM(SYS_USERNAM)
      ENDIF
      SWPRUNCMD(MSTRING)
    ENDIF
  ENDIF
  RETURN(.T.)

The public variables are as follows:
Code:
Psuedo constants
YES = "Y"
NO = "N"

SYS_CAPTURE - STRING NORMALLY "Y" OR "N"
SYS_LPT     - STRING NORMALLY "LPT1" OR "PORT"
SYS_QUEUE   - STRING WITH NAME OF QUEUE "\\SERVER\PRINTER"
SYS_USERNAM - STRING WITH NAME OF USER FOR AUTHENTICATION 
SYS_PERSIST - STRING NORMALLY "Y" OR "N"

Regards

Griff
Keep [Smile]ing
 
Griff

Did I read that correctly? XP will only let you capture an existing port? If so, my XP and a lot of my client's XP's are fauty, as they let me capture lpt1-3 no problem.



Ian Boys
DTE Systems Ltd
 
Oops

I am completely wrong, I've just done it on my own XP machine!

I am sure I have seen this before though, maybe it was on a Win 2K machine or pre SP2...

Sorry for spreading rubbish!

Regards

Griff
Keep [Smile]ing
 
Hi Griff,

The ability to capture is contained within the printer drivers AFAIK. I have some printers properties that have capture capabilities and some that don't.

Regards,

Mike
 
There may be a problem with Winprinters, those where all the processing is handled by Windows. I can't see it being part of the printer driver though, maybe the ability to be shared is - though I doubt that, but capture is really a DOS thing that connects to a shared printer to a virtual (or existing) port.

Ian Boys
DTE Systems Ltd
 
Hi Ian,

You can also use NET USE LPT3: \\computername\resourcename to capture to a resource. Use the /persistent:yes switch so it is remembered.

Regards,

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top