How to get print on any HP printer from DOS mode Foxpro software?

5 pts.
DOS program
HP Printer
I have prepared software in DOS mode (Foxpro 2.5) and doing well with Dot matrix printers but now the demand for Deskjet print out has increased and I am unable to provide the same as the commands from DOS mode. It's not supported to print on Deskjet printers... Anybody know the solution? Can anyone tell me how to do it?

Software/Hardware used:
foxpro 2.5

Answer Wiki

Thanks. We'll let you know when a new response is added.

To Print from DOS to USB Printer, u have to install MS Loopback Adapter. After installing,
Configure the Adapter.
Remember, loopback adapter is a virtual network adapter and can be configured the same as a regular network card. Set the adapter to have a static IP address, Share the printer and capture the printer port. Now open EDIT, and type the following :
@echo off
net use * /delete
net use LPT1: \\<Computer Name>\<Printersharename> /PERSISTENT:YES
and save the file as .bat extension.
NOTE: This guide for network printing….
If u want to print as a local printer, then….use Control Panel for DOS from the Starter CD of printer driver !
Before installing Control Panel, make sure the printer is set up and turned on.
1.Insert Starter CD into CD-ROM drive
2. Exit Windows to DOS and at the DOS prompt, i.e. C:\>, type the CD-ROM drive letter followed by a colon (:) and press ENTER.
3. Type CD \DOS\DJCP , and press ENTER. This will change to the directory containing the files for the Control Panel. (if the file not found, download from internet)
4. Type INSTALL and then press ENTER
5. Follow On-Screen instructions to complete installation.
6. Now change the usb printer directory (say, type CD \HP1020) and press ENTER
7. Type DJCP and press ENTER. This will start the Control Panel
8. Now select printer settings that are not available from DOS programs.
CAUTION: Printer settings that are selected from a DOS program may override printer settings selected from the Control Panel.
IMP NOTES: DOS programs are developed independently according to different standards, each DOS program requires its own printer drivers. If the DOS application does not show a selection for the specific printer, u can go for a substitute driver for a HP printer. U can use printer driver for DOS programs that do not provide support for HP Deskjet printers, HP LaserJet printer drivers can be used instead.

Another way u may download DOSPRN a small utility that may help to solve ur problems. For download: DOSPRN HERE.
For better concept and idea, please visit DOS2USB.
Hope it helps you!

Discuss This Question: 7  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Stevesz
    I print to a laser printer everyday from a DOS program at work. It works fine, being just straight text helps. All I do is to create a print queue for it like this: net use LPT1: \[machine name] I have it in a batch file that will delete any LPT1: currently existing, then run that command. Once run, that queue is active until you delete it, or the machine is shut down or restarted. The printers I use are networked printers. If your connection is a USB one, I cannot confirm or deny that this command will work, though I suspect it will.
    2,015 pointsBadges:
  • Srmservice60
    Dear Rechil You have answered to my querry regarding How to print from dos mode software to anyn HP printer... Thanks... You have taken lots of efforts. Still I am unable to print to Hp printer. 1. I have already installed the printer and working fine with windows. But does not working when I issue a print command from Dos software to Hp printer. I use simple command in foxpro 2.5 like .... SET PRINTER ON and it works. 2. I have down loaded the Dosprn files but still it is not working.
    15 pointsBadges:
  • Subhendu Sen
    I supply here the in-details for getting print on any Hp printer from Dos ! As I written earlier the same is here also..... Install the Microsoft Loopback Adapter 1. Open Control Panel > Add Hardware > Next 2. After scanning, select Yes, I have already connected the hardware and click Next Now select Add a new hardware device and click Next 3.Select Install the hardware that I manually select from a list (In Advanced option) & click Next 4. Select Network Adapters > Next > select Microsoft under the Manufacturer list 5. Select Microsoft Loopback Adapter in the Network Adapter list, select Next twice and click finish 6. Now configure the Adapter as given below Remember, loopback adapter is a virtual network adapter and can be configured the same as a regular network card. 7. Set the adapter with a static IP address with proper subnet musk Now share the printer and it is recommend use a proper share name. Now it is easy to capture the printer port by using this command.... net use LPT1: \[Computer Name]Printer /PERSISTENT:YES Here, computer name means, host name or u can use ip address also, and Printer means, printer share name. Further details and a solid guide is HERE Please bear in mind, that my answer is based on the details given in your last post. Please follow the steps and hope it will work for u also as it worked for mine earlier !
    141,190 pointsBadges:
  • jkbhatt
    When i use net use command in dos am geting "system error 67 occured" .... any solution
    10 pointsBadges:
  • Subhendu Sen
    @jkbhatt, what OS is there. Is it a domain concept. several causes might be there. Might be the network components on the domain controller are not configured correctly or network driver might has some problems, Please back with more details.
    141,190 pointsBadges:
  • Jogendramathur
    Print command in for pro dbffilr
    10 pointsBadges:
  • Vighnesh
    Another simple process is to create a prn/txt file while printing. 
    set printer to srmsoft.
    then using appropriate s/w like notepad++ or any other text editor, which can take huge text, as per your requirement.
    SET printer to
    will close

    Then u can print from that s/w.

    This is good for bulk printing
    125 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: