Solved

Fox 9 and Dos Printing Commands

Posted on 2010-08-30
11
512 Views
Last Modified: 2012-05-10
I am trying to send a report over the network to an HP LaserJet 4 printer attached to another computer (\\akl1\hplj4).  I tried 3-different ways to print the report. Here is the original FPDOS command: !copy /b contrac1.txt+crtinvce.pcl+outfile.txt lpt1 > nul

contrac1.txt is Hex code to set up the printer.
crtinvce.pcl is bitmapped code to produce a logo.
outfile.txt is straight ASCII characters (the report).

Can you suggest a way I can print this report?


Thank You

D
0
Comment
Question by:Malibucompany
  • 3
  • 2
  • 2
  • +2
11 Comments
 
LVL 19

Accepted Solution

by:
n2fc earned 168 total points
ID: 33563230
You neglect to state what the issue is...
Are you getting incorrect output or is it a network issue, such that the data never arrives at the printer?
0
 
LVL 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 111 total points
ID: 33563435
With XP and newer, you will probably not be able to do that.  The 'DOS' LPT1 isn't DOS, it is redirected thru the Windows printer driver which outputs PCL but doesn't understand it as input from LPT1.  If you can print to 'file', then you can use a regular Windows program to print it.  Or drag the printer over to that computer and plug it in to the parallel port.  In two other questions recently, we never got this method to work.  The formatting codes wouldn't get thru the driver to the printer.
0
 

Author Comment

by:Malibucompany
ID: 33563806
Hello n2fc... Sorry about that. Yes the data never arrives at the printer.
0
 
LVL 19

Assisted Solution

by:n2fc
n2fc earned 168 total points
ID: 33563847
OK, then...
Try opening a DOS (command) prompt and entering the below command:
net use LPT1 "\\akl1\hplj4"  /persisitent:no
Then try your printing again...
If it works, you can make that command into a batch file and run it once each time at startup...
0
 
LVL 19

Assisted Solution

by:n2fc
n2fc earned 168 total points
ID: 33563853
PS: You might also try concatenating a "page eject" control at the end (if necessary) to force the printer to flush out a partial page at end!
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:Malibucompany
ID: 33564221
Hello Dave Baldwin... The printer being used is USB. There is no parallel port on the computer. Also, reports created using standard @ … Say does print over the network. When I setup to use Printer Pooling I get the same result… The output does not make it to the printer. Any suggestions? Thanks for all your help.
0
 
LVL 29

Assisted Solution

by:Olaf Doschke
Olaf Doschke earned 111 total points
ID: 33564847
Yes printing has changed a lot from DOS to Windows, you typically have a driver handling the printing, you don't simply copy a txt to the lpt port anymore.

What you could try is use the generic/textonly printer driver, first go to the control panel, printers and install that printer if it isn't there already, if it's there go to it's properties and set it up to print to your network printer.

With it you can use ??? to print to the printer. Eg you could do ??? FILETOSTR("...outfile.txt")

Bye, Olaf.

0
 
LVL 29

Assisted Solution

by:Olaf Doschke
Olaf Doschke earned 111 total points
ID: 33564866
After the printer is prepared and before using ??? you SET PRINTER TO NAME "Generic / Text Only"

Bye, Olaf.
0
 
LVL 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 111 total points
ID: 33564900
I have a Laserjet 4 Plus and there is no USB available for the printer so you must be using an adapter.  You would have a better chance (still small) of getting to the printer if you have the Jet-Direct network card for it.  Unfortunately that could slug down your network if connected to the main network because it is a 10-BaseT interface.  I do have my printer on both the network interface and parallel interface on an XP computer and I am able to print over the network to it from my Windows 3.11 computer which is essentially DOS with networking.

Try printing straight text to your printer.  PCL codes probably won't go thru except it might print them instead of execute them.
0
 
LVL 2

Assisted Solution

by:FEOX
FEOX earned 110 total points
ID: 33566116
Try adding using this code:
** SELECT PRINTER:
  =SYS(1037)

  ** PRINT:
  ??? contrac1.txt
  ??? crtinvce.pcl
  ??? outfile.txt
  EJECT

Open in new window

0
 
LVL 2

Assisted Solution

by:FEOX
FEOX earned 110 total points
ID: 33566152
Sometimes, if special characters exists in the files to print, you may need to convert them from Windows to DOS codepage:


  ** SELECT PRINTER:

  =SYS(1037)



  ** PRINT CONVERTED CODE PAGE:

  PRIVATE n_WIN,n_DOS

  n_WIN = CPCURRENT()

  n_DOS = 437

  ??? CPCONVERT(n_WIN,n_DOS,contrac1.txt)

  ??? CPCONVERT(n_WIN,n_DOS,crtinvce.pcl)

  ??? CPCONVERT(n_WIN,n_DOS,outfile.txt)

  EJECT

Open in new window

0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
Find out what the Office 365 disclaimer function is, why you would use it and its limited ability to create Office 365 signatures.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now