Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Send Raw Data to a Printer
Message
From
25/09/2009 17:50:57
 
 
To
25/09/2009 17:37:15
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2008
Miscellaneous
Thread ID:
01426219
Message ID:
01426247
Views:
45
On which computer is the VFP EXE running, and how is it called/invoked?

>Actually it does work. After I restarted computers.
>Now, while this
>!NET USE LPT1: \\192.168.1.10\LawLabels
>work on a remote computer in the Command window, but refuses to execute when I run it an EXE called from ASP page (Web).
>Any idea?
>
>>>I am trying to print a text file to a printer that is shared and connected to another computer.
>>>
>>>>>Is that possible? I need it for Windows 2003. The printer is a network printer.
>>>>
>>>>Can you elaborate on why you're trying to do this?
>>>>
>>>>If the printer is a GDI printer then no, you can't send "raw data". If it has its own print engine you should be able to.
>>>>
>>>>There are several possible configurations for "network printers" - which is your case?
>>>>
>>>>1. Printer has a network card. Print jobs travel directly from workstations to the printer
>>>>2. Printer has a network card. Print jobs travel from workstations to a print queue on a server computer, which then sends them to the printer
>>>>3. Printer is directly attached to a server computer via USB, parallel cable etc. Print jobs travel from workstations to a print queue on this server, which sends them to the printer
>>
>>
>>REM On your workstation, in a CMD window:
>>REM Redirect your local LPT1: printer port to the shared printer's queue:
>>NET USE LPT1 \\ServerComputerName\SharedPrinterName (optional: add /persistent:y flag to end of this command)
>>
>>REM Print your text file by COPYing it to the LPT1: port with the binary switch:
>>COPY MyTextFile.txt LPT1 /B
>>
>>REM Disconnect your LPT1 printer port from the remote queue:
>>NET USE LPT1: /DEL
>>
>>The above will work only if the printer is NOT a GDI printer i.e. it supports printing from DOS applications.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform