Solved

Fox 9 and Dos Printing Commands

Posted on 2010-08-30
11
530 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 20

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 83

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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 20

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 20

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
 

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 83

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
The question appears often enough, how do I transfer my data from my old server to the new server while preserving file shares, share permissions, and NTFS permisions.  Here are my tips for handling such a transfer.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

810 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