Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using 'NET USE' command to redirect LPT1 output
Message
De
14/01/2001 17:49:57
 
 
À
14/01/2001 17:25:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00462995
Message ID:
00463603
Vues:
14
Ed,

I am printing your answer to allow myself extra time to digest it, especially the info about Win2K.

As you already know, since you have answered previous questions I have asked on this topic, my problem is that my FPD app writes to LPT1 and I _have_ to deal with this fact for now. This is the same that Novell's CAPTURE did.

I have already figured out how (more or less) how to redirect output in Win9x and NT 4.0 from the Windows shell, but as far as I know Win2K requires me to use the NET USE command from a command box. So I thought: time to write a VB applet to accomplish this once and for all. So here I am...


>
>You're going to run into interesting issues when attempting to associate a DOS device name for a device that actually exists on the local machine with a remote device; the exact device receiving the redirected output can be a real toss of the dice, especially if the physical device is shared to the network. I've seen some really bizarre results where a printer on LPT1: is shared to the net, and the local user then uses Novell's CAPTURE to redirect output to LPT1: to a Novell print queue.
>
>I'd recommend avoiding assigning actual physical ports to remote devices; Win9x supports up to LPT8: by default, NT lets you define port names through a Control Panel applet, and Win2K allows creation of port names through the Printers/Add New Printer dialog. Unfortunately, Win9x/WinME doesn't let you share a printer attached to one physical port and then attach it as a network printer to a different port; I've gotten around this by sharing a printer to the network, adding it to another system as a network device and sharing that, and then mapping the other machine's share of my networked printer back to a different port on the original machine; it's a kludge, adds a lot of baggage to the print output - there are actually three layers of spooling involved - but if you have to do it, it does work.
>
>The biggest problem with adding new port names is the assignment of the proper printer driver to the port; NT and 2K are not happy writing to a port that has no driver associated with it. The Wscript.Network AddNewPrinter method takes care of the nevcessary dialogs to associate/load drivers for remote printers that don't publish their drivers (you can set up a Windows printer to publish its driver for several OS versions when shared; both NT and Win2K will let you specify the OS driver models to publish for shared printers; most Win9x driver unstalls don't offer this useful service.)
>
>>Thanks for your reply.
>>
>>Alex
>>
>>
>>
>>>>Hi,
>>>>
>>>>Does anybody have detailed information on the NET USE command. I need it to redirect printer output from LPT1: to a printer in the network in Win2000.
>>>>
>>>>TIA,
>>>>
>>>>Alex
>>>
>>>There is a native command,
SET PRINTER TO NAME \\<i>servername\sharedprintername
If you want to use NET USE, as with all command-line utilities NET /? in a DOS box will get you close, and NET HELP USE closer still.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform