Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Good way to capture printer port from within VFP
Message
From
11/02/2002 14:33:43
 
 
To
11/02/2002 13:24:55
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00618466
Message ID:
00618515
Views:
12
>I need to do the equivalent of a NET USE command to capture output to a printer port to a network printer.
>
>I have been using Ed Rauh's APIRun class to issue a dos command to do this...which works fine on my 2000 box, but hangs on the win98 boxes, as the net command does not terminate...sits there in the 'Finished' state.
>
>I know I can do this by setting up a PIF file on each worstation for the net.exe command, but there are a LOT of workstations.
>
>Is there a cleaner way to capture the port? Barring that, is there a way I can make the dos windows exit witout going around to each machine and setting up that PIF?

You can use the WNetAddConnection2() or WNetAddConnection3() API calls to attach a network printer to a local port - my NETRESOURCE class includes an example implementation of WNetAddConnection3().
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform