?
Solved

why does using the copy /b command to download fonts to hp work in win98 but not xp

Posted on 2006-03-22
18
Medium Priority
?
750 Views
Last Modified: 2013-12-03
Situation is combining windows foxpro lan 2.0 and novell intranetware 4.11.  When I had to upgrade to Win98 years ago, I was able to get this to work with bindery only login.  Now on Win XP, this does not work.  Everything else about the code works except this code which downloads custom MICR fonts to the hp.  The p0setprn command sets console, off, sets output to printer, set printer on.

  IF mdl .OR. (malign .AND. mfirst)
    DO p0setprn WITH 'OFF','PRINTER','ON',0
    * ' Delete All fonts Currently in printer
    ** ! delfont
    * ' Id the font '
     * ' Bank Name Fonts'
    ??mesc+'*c' + mbfid1 + 'D'
    ! COPY /B &mbf1 prn >nul
    ?? mesc + '*c5F'

    ??mesc+'*c' + mbfid2 + 'D'
    ! COPY /B &mbf2 prn >nul
    ?? mesc + '*c5F'

    * ' Names'
    ??mesc+'*c' + mnfid1 + 'D'
    ! COPY /B &mnf1 prn >nul
    ?? mesc + '*c5F'

    ??mesc+'*c' + mnfid2 + 'D'
    ! COPY /B &mnf2 prn >nul
    ?? mesc + '*c5F'
    * ' Check Number '
    ??mesc + '*c' + mcfid + 'D'
    ! COPY /B &mckf prn >nul
    ?? mesc + '*c5F'

*\\ jjac 05/26/03
  IF mform = "ROFC"
    ??mesc + '*c' + mafid + 'D'
    ! COPY /B &maf1 prn >nul
    ?? mesc + '*c5F'
  Endif
*\\
*\\ jjac 09/28/04
  IF  mform = 'IDODEP'
    ??mesc+'*c' + mnfid1jj + 'D'
    ! COPY /B &mnf1jj prn >nul
    ?? mesc + '*c5F'
  Endif
*\\
    STORE TRIM(mmicrfont) TO mfstr
    ??mesc  + '*c' + mmid +'D'
    !COPY /B &mfstr prn >nul
    ?? mesc + '*c5f'
    * ' MICR Font'
    * ' Portrait or Landscape'
    * 'Evaluate for Landscape or Portrait Mode'
    STORE .F. TO mdl
  ENDIF                                          && mdl .OR. (malign AND. mfirst)

  DO p0setprn WITH 'ON','SCREEN','OFF',0


Tried variations of the copy command (ie  !copy &mfstr /b prn /b, etc), tried xcopy, tried 'type &mfstr > prn, tried replacing prn with lpt1.  NO luck.  Running out of time, and welcome any suggestions.

Thank you in advance for your assistance.

0
Comment
Question by:jjackson2004
  • 9
  • 5
  • 2
  • +2
18 Comments
 
LVL 1

Expert Comment

by:elitehaxor
ID: 16264723
windows 98 got everything to work, Xp,s copy command is not the same as XP,s copy command there are better 32bit copy programs out there try one of these to see if they alleviate the problem

hope that helps
Cheers
0
 

Author Comment

by:jjackson2004
ID: 16264774
have not been able to find a 'copy' replacement, so if you know of any, please let me know.
0
 
LVL 57

Expert Comment

by:giltjr
ID: 16265183
What is the problem?  Is that only text data makes it to the printer or that nothing goes to the printer?

Is it the same printer with the same level of print drivers?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:jjackson2004
ID: 16265360
The downloaded fonts are not making it to the printer
0
 
LVL 7

Expert Comment

by:sunilcomputer
ID: 16266077
To print your files from dos
Put the .prn file somewhere where it is easy to find it.
Notice, if you saved your .prn file with a different printer, you might end with mess, because those files are specific for printer.
prn software will do away with that.

Go to the MS-DOS prompt and, if your file is in the Windows folder, at the C:\windows> prompt type:
copy yourdoc.prn LPT1 /B
This commend sends your file to printer for output.

Some software options for you

http://www.lerup.com/printfile/

http://www.gallicrow.co.uk/Imprint.html

http://www.eprintdriver.com/driver-features.html

http://aegisknight.org/print_to_pdf.html

http://www.jawspdf.com/pdf_creator/features.html

http://www.pstill.com/

Other Solutions :-

http://www.experts-exchange.com/Applications/Q_20515598.html?query=print+prn&searchType=topic
http://www.experts-exchange.com/Applications/Q_10317911.html?query=print+prn&searchType=topic

Hope this helps,
0
 
LVL 16

Expert Comment

by:Joseph Nyaema
ID: 16267756
Had a similar problem with printing to a netware printers.

Solution was to use a virtual machine running windows 98.
The application ran in the windows 98 virtual machine.

The Windows XP printer driver model interferes with traditional
DOS printer commands.

VMWare is the VM of choice.

VMware Workstation
http://www.vmware.com/products/ws/

VMware Player (Free)
http://www.vmware.com/products/player/

VMWare Server (Free)
http://www.vmware.com/products/server/

There is also Virtual PC but has issues with resource use hopefully fixed with SP1.
http://www.microsoft.com/windows/virtualpc/default.mspx
0
 
LVL 57

Expert Comment

by:giltjr
ID: 16268490
Do you actullay have the priner associated with the device PRN or LPT1?

Under XP printers are NOT automatically associated with these names, especially if they are LAN attached.

If LAN attached, you need to do something like:

   NET USE LPT1 \\server\printername

Where server is the name of the printer server and printername is the printer.
0
 

Author Comment

by:jjackson2004
ID: 16272715
(New problem at the end of this tome)

Thanks for all the suggestions.  Just read them this morning, since the Internet has been out down here in the tropics)  Working late into the night last night, I was able to come up with a solution to that immediate problem by modifying the code to capture the escape codes to a txt file and then copy the text files to the printer :

   if lc_ostype = "Windows_NT" (actually xp, but not being picky)

     * ' Bank Name Fonts'
    set alte to c:\temp\text1.txt
    set alte on
    ??mesc+'*c' + mbfid1 + 'D'
    set alte off
    set alte to c:\temp\text2.txt
    set alte on
    ?? mesc + '*c5F'
    set alte off
    set alte to

    ! COPY /B c:\temp\text1.txt + &mbf1 + c:\temp\text2.txt prn >nul
*    ?? mesc + '*c5F'

    set alte to c:\temp\text3.txt
    set alte on
    ??mesc+'*c' + mbfid2 + 'D'
    set alte off
    set alte to c:\temp\text4.txt
    set alte on
    ?? mesc + '*c5F'
    set alte off
    set alte to

    ! COPY /B c:\temp\text3.txt + &mbf2 + c:\temp\text4.txt prn >nul

*    ! COPY /B &mbf2 prn >nul
*    ?? mesc + '*c5F'

    * ' Names'
    set alte to c:\temp\text5.txt
    set alte on
    ??mesc+'*c' + mnfid1 + 'D'
    set alte off
    set alte to c:\temp\text6.txt
    set alte on
    ?? mesc + '*c5F'
    set alte off
    set alte to

    ! COPY /B c:\temp\text5.txt + &mnf1 + c:\temp\text6.txt prn >nul
*    ??mesc+'*c' + mnfid1 + 'D'
 *   ! COPY /B &mnf1 prn >nul
 *   ?? mesc + '*c5F'

    set alte to c:\temp\text7.txt
    set alte on
    ??mesc+'*c' + mnfid2 + 'D'
    set alte off
    set alte to c:\temp\text8.txt
    set alte on
    ?? mesc + '*c5F'
    set alte off
    set alte to

    ! COPY /B c:\temp\text7.txt + &mnf2 + c:\temp\text8.txt prn >nul

*    ??mesc+'*c' + mnfid2 + 'D'
*    ! COPY /B &mnf2 prn >nul
*    ?? mesc + '*c5F'

    * ' Check Number '
    set alte to c:\temp\text9.txt
    set alte on
    ??mesc+'*c' + mcfid + 'D'
    set alte off
    set alte to c:\temp\text10.txt
    set alte on
    ?? mesc + '*c5F'
    set alte off
    set alte to

    ! COPY /B c:\temp\text9.txt + &mckf + c:\temp\text10.txt prn >nul
*    ??mesc + '*c' + mcfid + 'D'
*    ! COPY /B &mckf prn >nul
*    ?? mesc + '*c5F'

*\\ jjac 05/26/03
  IF mform = "ROFC"
    set alte to c:\temp\text11.txt
    set alte on
    ??mesc+'*c' + mafid + 'D'
    set alte off
    set alte to c:\temp\text12.txt
    set alte on
    ?? mesc + '*c5F'
    set alte off
    set alte to

    ! COPY /B c:\temp\text11.txt + &maf1 + c:\temp\text12.txt prn >nul

*    ??mesc + '*c' + mafid + 'D'
*    ! COPY /B &maf1 prn >nul
*    ?? mesc + '*c5F'
  Endif
*\\
*\\ jjac 09/28/04
  IF  mform = 'IDODEP'
    set alte to c:\temp\text13.txt
    set alte on
    ??mesc+'*c' + mnfid1jj + 'D'
    set alte off
    set alte to c:\temp\text14.txt
    set alte on
    ?? mesc + '*c5F'
    set alte off
    set alte to

    ! COPY /B c:\temp\text13.txt + &mnf1jj + c:\temp\text14.txt prn >nul
*    ??mesc+'*c' + mnfid1jj + 'D'
*    ! COPY /B &mnf1jj prn >nul
*    ?? mesc + '*c5F'
  Endif
*\\
    STORE TRIM(mmicrfont) TO mfstr
    set alte to c:\temp\text15.txt
    set alte on
    ??mesc+'*c' + mmid + 'D'
    set alte off
    set alte to c:\temp\text16.txt
    set alte on
    ?? mesc + '*c5F'
    set alte off
    set alte to

    ! COPY /B c:\temp\text15.txt + &mfstr + c:\temp\text16.txt prn >nul
*    ??mesc  + '*c' + mmid +'D'
*    !COPY /B &mfstr prn >nul
*    ?? mesc + '*c5f'
    * ' MICR Font'
    * ' Portrait or Landscape'
    * 'Evaluate for Landscape or Portrait Mode'
    STORE .F. TO mdl

else


This worked for the printer I was testing on which was a HP 5Si MX.  Today, the users came in and promptly rained on my celebration by printing to a different printer and having a problem occur.  The problem is that on the other printers, each of the copy commands causes a page to be ejected with a couple of left pointing arrows on it.  

I tried modifying the copy command to move the '/b' command to various positions (after reading up on xp copy command and the differences between where the /b is placed).  If I place it after the source, or after the dest, or both, I receive a buffer overflow on the printer.  Tried combining the commands into one big one, but exceeded the antiquated string length of 255 chars.  

The other printers are HP 5SI, and HP 8150N's.  I have been racking my brain trying to figure out why they would print differently than the others.
Finally realized the difference, and here is where I now need help:

The printer that is working is connected directly to the network through it's internal IO card.  The other three are connected through a JetDirect.  Go figure.  So now I am welcoming any suggestions why this is (the two 8150 printers have an IO card in them, but we are limited in our physical wired connections, so that is why they are sharing the jetdirect)

I look forward to any assistance.

0
 

Author Comment

by:jjackson2004
ID: 16272745
To clarify the problem with the printers, they print out 6 blank pages and then print out the expected pages correctly.  But my users are not happy about the 6 pages with the two arrows on them.

0
 

Author Comment

by:jjackson2004
ID: 16272843
And one more item, this is an ipx network , not ip.
0
 
LVL 57

Expert Comment

by:giltjr
ID: 16274114
I am assuming that when you say a "JetDirect" card you mean a external one?  IIRC all of the HP printers internal LAN card are JetDirects.

The six pages with the arrows on them are basically commands that the printer did not understand and the arrows are the printers attempt to print the "charcters".

Are there only 6 pages with the arrorws total?  When you left arrows do you mean <  or do you mean something like <- ?
0
 

Author Comment

by:jjackson2004
ID: 16274802
From you statement, it would appear that the hp5si and hp5si mx don't use the same commands, since 5si mx understands it.

something like <- but the graphical version.

6 pages that match the six copy commands.
0
 
LVL 57

Expert Comment

by:giltjr
ID: 16275013
It appears that that is the "leftward arrow" which is a special encoding.  If codeing in a HTML plage you would put:

     &#8592

for decmial value or:

     &#x2190

for hex value.  Not sure if there is an easy way for you to check to see if you have that somewhere in the data unescaped.
0
 

Author Comment

by:jjackson2004
ID: 16276827
Clarification  - they are both jetdirects

The internal (HP5SiMX) is a jetdirect J2552B and the external is a JetDirect EX Plus 3 J2593A

All setting seem similar.
0
 
LVL 57

Accepted Solution

by:
giltjr earned 2000 total points
ID: 16277038
I'm not a FoxPro person  what does:

     ?? mesc + '*c5F'
     ??mesc+'*c' + mmid + 'D'

do?  What are in the text files that you are copying?

What do you expect

    ! COPY /B c:\temp\text1.txt + &mbf1 + c:\temp\text2.txt prn >nul

to do?  Are text1.txt and text2.txt actully a text file?  What is &mbf1?  If text1.txt and text2.txt text files and &mbf1 is binary you may want to try:


    ! COPY c:\temp\text1.txt /a +  &mbf1 /b +  c:\temp\text2.txt /a  prn >nul

Or:

       ! COPY c:\temp\text1.txt /a +  &mbf1 /b +  c:\temp\text2.txt /a  prn /a >nul
0
 

Author Comment

by:jjackson2004
ID: 16277233
The first part are hp escape codes.  the first one (which is actually the second one in the code) sets the font as permanent, the second (first) tells the printer what the font id is going to be.  the &mbf1 is a macro expansion that will put the actual font file name in the statement.  It is a binary file.  As far as the text files, if the escape code <esc> can be considerd as ascii, then it might work.  Remember this is a xp machine which handles the /b differently.  I will give it a try.  

The program originally redirects output to printer instead of the console and the ?? means echo to the output device without a cr/lf.  A ? by itself will put the information following the ? on a new line.

Since the program under xp did not seem to be putting the data out to the printer, I used the set alte to/on command to send the output to a disk file that I could copy.

I realize this was a lousy job of explaining, but it is late and I am tired, but cannot stop working since I will be heading back to the states on Saturday.

Thanks for your assistance.
0
 

Author Comment

by:jjackson2004
ID: 16277338
you da man, er, woman, er person, uh, sentient being.

The last hurdle has been crossed.

I get to go home to see my children.

The world seems such a happier place suddenly.

In other words, thank you very much.  It is always the simple things that seem to be so hard.

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction How to create multiboot configuration with XP\Vista and Windows 7 on it? And most important question - how to do this correctly so not to have any kind of nightmares we get when system gets screwed? First of all one should realize t…
Sometimes a user will call me frantically, explaining that something has gone wrong and they have tried everything (read - they have messed it up more and now need someone to clean up) and it still does no good, can I help them?!  Usually the standa…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

850 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