How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask Suryanto Your Own Question

Suryanto
Suryanto, Programmer
Category: Programming
Satisfied Customers: 538
Experience:  8 years experience in VBA(Excel, Word, Outlook and Access)
48489642
Type Your Programming Question Here...
Suryanto is online now
A new question is answered every 9 seconds

How can I redirect printer output to LPT1 (in a useful DOS

Resolved Question:

How can I redirect printer output to LPT1 (in a useful DOS database programme) to a USB port
Submitted: 3 years ago.
Category: Programming
Expert:  Jason replied 3 years ago.

Programmer Extraordinaire :

Greetings,

Please, follow the instructions below:
- Share your printer by right clicking the printer, choosing Sharing, enabling sharing.

NET USE LPT1: \\YourComputerName\PrinterSharedName

Programmer Extraordinaire :

Of course, replace YourComputerName with the name of your computer and the PrinterSharedName field with the name of the share you created in the first step.

Programmer Extraordinaire :

Please, do not forget to click the Accept button if you found my answer helpful.

After you click the Accept button now, you can always continue communication with me if you have problems by logging into this site and pulling up this chat history.

Thank you,
- Jason

Customer:

I'm aware of this command but can't get it to work

Programmer Extraordinaire :

Ok

Programmer Extraordinaire :

You already have the printer shared?

Programmer Extraordinaire :

What else have you done that has not worked? If I know this, it will save us both a lot of time because it will not force me to repeat suggestions that you have already tried.

Customer:

The printer is connected direct to the computer - not on a network. The NET USE command is only for networks isnt it? When I right click on the printer, it does not offer a sharing option. I have tried entering the NET USE at the DOS prompt as "NET USE LPT1: \\PETER-PC\HP Deskjet 2400 series" but it assumes the command is wrong and gives me the syntax. The program I am using is dBaseIV 1.5 which sends printer output only to LPT1, LPT2,COM1,COM2,COM3 or COM4. Is there a MODE command which will help?

Programmer Extraordinaire :

Thank you for the update.

Programmer Extraordinaire :

Right click the printer, choose properties, click the sharing tab, enable sharing, give the printer a share name, and click the Apply button.

Programmer Extraordinaire :

Once that is complete, the net user lpt1: \peter-pc\hp command will work.

Programmer Extraordinaire :

oops

Programmer Extraordinaire :

net use not net user

Customer:

Looks promising. Do I need to put all or some of this command in " " quotes as there are spaces in the printer name?

Programmer Extraordinaire :

I suggest that you do not put any spaces in the printer name.

Programmer Extraordinaire :

Is there anything else I can help you with today before you click the Accept button?

Programmer Extraordinaire :

Please, do not forget to click the Accept button if you found my answer helpful.

After you click the Accept button now, you can always continue communication with me if you have problems by logging into this site and pulling up this chat history.

Thank you,
- Jason

Programmer Extraordinaire :

Once you click the Accept button, your deposit that you have already been charged, will be released. I only I get credit from the website or get paid for my time if you click the Accept button.

Customer:

I have done what you suggested and named the printer HPF2480 and rentered the command "NET USE LPT1: \\PETER-PC\HPF2480" and the command is accepted. But the program still won't print saying that LPT1 is an invalid port - evn though I have issued the dBase command "SET PRINTER TO LPT1". Why wont it print?

Programmer Extraordinaire :

Did you enable to route the LPT1 port to the ms-dos environment?

Customer:

Not sure what you mean? The NET USE command above surely sets up LPT1 to connect to the shared printer doesn't it? What else should I do?

Programmer Extraordinaire :

Do not put the colon after the lpt1 tag

Programmer Extraordinaire :

Type the following command:
net use LPT1 "\\Peter-PC\HPF2480" /Persistent:Yes

Programmer Extraordinaire :

And then press enter.

Programmer Extraordinaire :

Then, please verify that it is functioning.

Customer:

Going off to do it

Programmer Extraordinaire :

Thank you

Programmer Extraordinaire :

You can also type the following command to make sure it all looks correct:

net view \\%computername%

Customer:

No joy yet. The above NET VIEW comd gave Path not found Error 53

Programmer Extraordinaire :

Which operating system are you using?

Customer:

Windows 7

Programmer Extraordinaire :

Thank you

Programmer Extraordinaire :

You typed in the same exact command? net view \\%computername%

Programmer Extraordinaire :

Exactly.

Customer:

I typed in "net view \\ %PETER-PC%" . I'll try it again.

Programmer Extraordinaire :

No.

Programmer Extraordinaire :

Do not type that.

Programmer Extraordinaire :

Type this: net view \\%computername%

Programmer Extraordinaire :

Then press enter.

Customer:

Sorry, trying to be too clever! Result: "HPF2480 Print LPT1 HP Deskjet F2400 series. The command completed successfuly"

Programmer Extraordinaire :

You should not get that message when you type in new view

Programmer Extraordinaire :

When you type in the net view command, what is shown under the "Share Name" header?

Customer:

HPF2480

Programmer Extraordinaire :

Thank you

Programmer Extraordinaire :

So, you are typing the following command?

net use LPT1 "\\Peter-PC\HPF2480" /Persistent:Yes

Customer:

Yes, but I had to enter "net use LPT1 /D" first otherwise it wouldn't accept the command, Then it said command accepted successfully.

Programmer Extraordinaire :

ok

Programmer Extraordinaire :

Ok..

Programmer Extraordinaire :

This is curious...

Programmer Extraordinaire :

When you print to the LPT1 port, are you given any error?

Customer:

Not by DOS. But dBase says either 'Printer not ready' or if I 'SET PRINTER TO \\PETER-PC\HPF2480=LPT1' it tells me 'Port not recognised'

Programmer Extraordinaire :

Ok, that is peculiar.

Programmer Extraordinaire :

It should work as it is now.

Customer:

So it should - but it doesn't!

Programmer Extraordinaire :

I have run out of ideas.

For this reason, I am opting out of the question and allowing another expert the chance to help.

I wish you luck // Peace.

Customer:

Thanks for trying PE - can't make it out.

Expert:  Suryanto replied 3 years ago.
Dear Customer,

Welcome to Justanswer.

I am Suryanto and I can help you with this

You can use DOSPrint. Please download Dosprint.zip from http://www.andtechnologies.com/index.php?q=downloads/free-software

Extract the file to a folder then double click file DOSPRINTUI
An icon will appear in the tray - bottom right of screen. You can double click the dosprint icon
graphic
Select LPT1 and click Set. You can select the Deskjet Printer
LPT1 will be set to the Deskjet Printer
Click OK to close
You can try to print again with the DOS Program and the LPT1 will be redirected to the Deskjet Printer

If this helps, please click ACCEPT on my answer (don't misclick on others answer Smile) so I am paid for my time.
If you still have problem, please let me know.
Bonus and Positive Feed Back are highly appreciated.

Thank you
Suryanto
Customer: replied 3 years ago.
Not quite sure what I'm doing here Suryanto. I've downloaded DOSPRINT.EXE into SYSTEM32 folder - and clicked on it - but nothing seems to be happening. What am I doing wrong?
Customer: replied 3 years ago.
Have just realised that there may be a significant reason why this is causing diffiulties. I am attempting to print from DOS program dBaseIV 1.5 through LPT1. But dBase is a 32 bit system and Windows 7 is 64 bit and doesn't let dBaseIV work properly. So I am using DOSBOX to create a virtual 32 bit environment in which dBaseIV will operate (and does for all normal activities. So far, not having a printer for my laptop, I have printed to file and run the file off another computer. Now I have a new HP deskjet I need to have it communicating with the program.
Customer: replied 3 years ago.
I see its only 6pm where you are - but its time for bed here in UK. Can we continue this tomorrow please. If you are able to suggest a way forward, I shall be able to give it a try in about 8 hours time. I hope this suggestion works for you.
Expert:  Suryanto replied 3 years ago.
Hi,

Extract the file to a folder then double click file DOSPRINTUI (don't double click DOSPRINT, but DOSPRINTUI)
An icon will appear in the tray - bottom right of screen. You can double click the dosprint icon

graphic

graphic
View Full Image

Select LPT1 and click Set. You can select the Deskjet Printer
LPT1 will be set to the Deskjet Printer
Click OK to close
graphic

You can try to print again with the DOS Program and the LPT1 will be redirected to the Deskjet Printer

If this helps, please click ACCEPT on my answer (don't misclick on others answer Smile) so I am paid for my time.
If you still have problem, please let me know.
Bonus and Positive Feed Back are highly appreciated.

Thank you
Customer: replied 3 years ago.
I have now carried out the procedure as detailed above, including downloading the Zip file, extracting DOSPrintUI.exe and double clicking on it. The icon appeared and clicking on it enabled me to highlight LPT1 and SET it to the Deskjet Printer. I have then opened up dBaseIV and SET PRINTER TO LPT1 (and confirmed it) - but the program still says "Printer not ready". As I have to run dBaseIV with the help of DOSBox (which creates a 32-bit environment for dBase to work in), could this be affecting the redirection? Incidentally, the printer and dBase work perfectly on their own - but won't communicate it seems. Do you, or any of your colleagues, know if there is a dBase solution to this. I feel sure it can be cracked - but have no idea what else to try. Thanks for all you're doing for me - but I need a solution.
Expert:  Suryanto replied 3 years ago.
Hi,

Yes, The DOSBox affected the redirection. After doing research, I found the solution.

Please download and install this DOSBox version that support paralel port from
http://home.arcor.de/h-a-l-9000/megabuild.html

I will give you the instruction in a moment

Thank you
Expert:  Suryanto replied 3 years ago.
After installed, Click Start - DOSBox MB6 - Configuration - Edit Configuration

In printer section, change printer=true,printoutput=printer, multipage=true

[printer]
# printer: Enable printer emulation.
# dpi: Resolution of printer (default 360).
# width: Width of paper in 1/10 inch (default 85 = 8.5'').
# height: Height of paper in 1/10 inch (default 110 = 11.0'').
# XXXXX: Output method for finished pages:
# png : Creates PNG images (default)
# ps : Creates Postscript
# bmp : Creates BMP images (very huge files, not recommend)
# printer : Send to an actual printer (Print dialog will appear)
# multipage: Adds all pages to one Postscript file or printer job until CTRL-F2 is pressed.
# docpath: The path where the output files are stored.
# timeout: (in milliseconds) if nonzero: the time the page will
# be ejected automatically after when no more data
# arrives at the printer.

printer=true
dpi=360
width=85
height=110
printoutput=printer
multipage=true
docpath=.
timeout=0

In Paralel section, change parallel1=printer

[parallel]
# XXXXX: parallel1-3 -- set type of device connected to lpt port.
# Can be:
# reallpt (direct parallel port passthrough using Porttalk),
# file (records data to a file or passes it to a device),
# printer (virtual dot-matrix printer, see [printer] section)
# Additional parameters must be in the same line in the form of
# parameter:value.
# for reallpt:
# Windows:
# realbase (the base address of your real parallel port).
# Default: 378
# ecpbase (base address of the ECP registers, optional).
# Linux: realport (the parallel port device i.e. /dev/parport0).
# for file:
# dev: (i.e. dev:lpt1) to forward data to a device,
# or append: appends data to the specified file.
# Without the above parameters data is written to files in the capture dir.
# Additional parameters: timeout: = how long to wait before
# closing the file on inactivity (default:500), addFF to add a formfeed when
# closing, addLF to add a linefeed if the app doesn't, cp:
# to perform codepage translation, i.e. cp:437
# for printer:
# printer still has it's own configuration section above.
# XXXXX: see parallel1
# XXXXX: see parallel1

parallel1=printer
parallel2=disabled
parallel3=disabled


Save the configuration file.

Click Start- DOSBox M6- DOSBox to run DOS Box and your program.

Hope this helps

Thank you
Expert:  Suryanto replied 3 years ago.
Hi,

Another solution is to use DOSPRN. I have tested this and it worked

You can read about DOSPRN here
http://www.dosprn.com/readme.htm

Download the program here
http://www.dosprn.com/download.htm

Read and follow the guide to solve your problem here (Does DOSPRN work with Vista and Windows Seven 64 bit ?)
http://www.dosprn.com/faq.htm#24

Please let me know the progress

If this helps, please click ACCEPT on my answer
Bonus and Positive Feed Back are highly appreciated

In meantime, I have to logoff because here it is 10.20PM. I will reply when I login again

Thank you
Customer: replied 3 years ago.
I have installed DOSPRN as described - but this has made no difference to the DOS print function in dBase. This still says 'Printer not ready' when I press Print. I'm reluctant to load DOSBOX MB6 as I'm sure it will interfere with existing DOSBox won't it? Presumably I can uninstall DOSPrintUI now?
Customer: replied 3 years ago.
It's midnight here so I'm off to bed. Talk to you tomorrow.
Expert:  Suryanto replied 3 years ago.
Hi,

You have to install DOSBox MB6 because this version can redirect LPT1. It will make a new icon and won't replace the old DOSBox.

If you use the old Dosbox, you can't redirect LPT1

Thank you
Customer: replied 3 years ago.
Thanks, XXXXX XXXXX'm going to try it now. You have suggested the command lines that must go into the Configuration file. My present DOSBox version also contains the Mount commands that put the database program and files into the right place. Presumably I shall need to put them at the end og the new Config file as follows: "[autoexec]
# XXXXX in this section will be run at startup.
# XXXXX can put your MOUNT lines here.
mount c c:\Oldprogs
C:
cd database
\dbase\dbase
exit" Am I right?
Expert:  Suryanto replied 3 years ago.
Yes, you need to add it in the dosbox mb6 configuration file. thank you
Customer: replied 3 years ago.
Sorry, but I can't work out how to download DOSBox MB6 from the link you've given. I am assuming that downloads of DOSBox MB6 are free like DOSBox itself. The link makes no mention of the Megabuild package. Where am I going wrong?
Expert:  Suryanto replied 3 years ago.
Select mirror from Download:
Megabuild 6: Windows Installer: archiv.to megaupload.com mirror

OR Download from here
http://tinyurl.com/6k63stz

Thank you
Customer: replied 3 years ago.
Have carried out the instructions as detailed. The DOSBox MB6 has loaded and I have adjusted the configuration file to include all the extra points. But now, instead of reporting 'Printer not ready' it says 'now printing' but there is no activity from the printer and the progam hangs. I think we've gone as far as is reasonable - but I'm no further forward. What happens to my deposit, please?
Expert:  Suryanto replied 3 years ago.
Hi,

Have you followed the instruction and make sure you didn't miss something ?
I have tested with DOSPRN and it worked.
Have you tried simple DOS Command DIR >LPT1 ?

We get nothing until customer click Accept. If you don't want to continue, you can ask for refund and get your deposit back.

Thank you
Customer: replied 3 years ago.
DIR > LPT1 didn't work. entered NET USE to discover that LPT1 was disconnected. So I connected it with "NET USE LPT1 \\peter-pc\hpf2480" which then showed LPT1 as OK. I have also clicked on DOSPRN but I'm not sure how you can tell if it's working. DIR > LPT1 still doesn't work. What am I doing wrong?
Expert:  Suryanto replied 3 years ago.
Don't use NET USE COMMAND

Double click DOSPRN and make sure you enter "C:\TEMP\PRNSPL" value in the 'Spool filename (filemask)' entry field.

graphic

Have you done this step
c) Chose "Edit Configuration" DOSBOX option from the main menu and modify "parallel" section in the such way: [parallel]
parallel1=file append:c:\temp\prnspl
parallel2=disabled
parallel3=disabled

d) Create C:\TEMP directory if it does not exist

Thank you
Customer: replied 3 years ago.
Have done everything as you said. I've disconnected LPT1 with NET USE LPT1 /D, I've dpouble clicked on DOSPRN and entered C:\TEMP\PRNSPL" in spool filename, I've created c:\temp and changed config file to parallel1=file append:c:\temp\prnspl - but the outcome is as before. Says 'Now printing' but isn't. This is all most depressing. Have you any ideas left? I'm happy to pay you extra if we can crack it.
Expert:  Suryanto replied 3 years ago.
Hi, could you open the dosbox mb6 configuration file and save as a text file then upload to www.wikisend.com ? after upload you will get page that has fileid and download link. please tell me the fileid or download link so I can check it for you. Thank you
Customer: replied 3 years ago.
Here is the wikisend link: http://wikisend.com/download/442148/configuration.txt
Customer: replied 3 years ago.
Hope you got the download. I must get to bed now. Talk tomorrow.
Expert:  Suryanto replied 3 years ago.
Ok. Got the file. I will check it
Thank you
Expert:  Suryanto replied 3 years ago.
Hi,

I have tested the configuration. and it worked fine in my place.
This is generated PDF file using DIR >LPT1 redirected to CutePDF
http://wikisend.com/download/657932/DOS-box document 6_4_2011 5_52_00.pdf

Make sure printer is set correctly in DOSPRN
graphic

If still have problem, make a shortcut to DBASE.EXE
Then set compatibilty in the application compatibility mode
http://www.w7forums.com/application-compatibility-mode-t314.html
Use DOSPRINTUI to redirect LPT1 to the printer
Start Dbase and test print again
Quit Dbase and check if the printing process is started or not

Thank you
Suryanto, Programmer
Category: Programming
Satisfied Customers: 538
Experience: 8 years experience in VBA(Excel, Word, Outlook and Access)
Suryanto and 7 other Programming Specialists are ready to help you
Customer: replied 3 years ago.

Running dBase in compatibility mode looks a good idea, Suryanto. But my computer says "access denied" when I try to save the new icon. How do I get control of my own computer?

Expert:  Suryanto replied 3 years ago.
Make sure you login with user Administrator or user with administrator level or access. Thank you
Customer: replied 3 years ago.
Suryanto - unfortunately everything I've tried has failed to work. So I think it's time to call a halt. I have decided that the best way is simply to print to file and to print the files from Word or similar. So thanks for all your help. You've done your best. I shall now press the Accept button.

JustAnswer in the News:

 
 
 
Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.
 
 
 

What Customers are Saying:

 
 
 
  • My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed. One Happy Customer New York
< Last | Next >
  • My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed. One Happy Customer New York
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
  • This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex Los Angeles, CA
  • Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP Hesperia, CA
  • I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, NC
  • Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around. Esther Woodstock, NY
  • Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know. Robin Elkton, Maryland
 
 
 

Meet The Experts:

 
 
 
  • ATLPROG

    Computer Software Engineer

    Satisfied Customers:

    7463
    MS in IT.Several years of programming experience in Java C++ C C# Python VB Javascript HTML
< Last | Next >
  • http://ww2.justanswer.com/uploads/SP/spatlanta2010/2011-6-23_12450_photo.64x64.gif ATLPROG's Avatar

    ATLPROG

    Computer Software Engineer

    Satisfied Customers:

    7463
    MS in IT.Several years of programming experience in Java C++ C C# Python VB Javascript HTML
  • http://ww2.justanswer.com/uploads/ComputersGuru/2010-02-13_051118_Photo41.JPG LogicPro's Avatar

    LogicPro

    Computer Software Engineer

    Satisfied Customers:

    5603
    Expert in C, C++, Java, DOT NET, Python, HTML, Javascript, Design.
  • http://ww2.justanswer.com/uploads/unvadim/2010-11-15_210218_avatar.jpg unvadim's Avatar

    unvadim

    Computer Software Engineer

    Satisfied Customers:

    1158
    Good knowledge of OOP principles. 3+ years of programming experience with Java and C++. Sun Certified Java Programmer 5.0.
  • http://ww2.justanswer.com/uploads/lifesaver333/2010-10-17_191349_ls.jpeg lifesaver's Avatar

    lifesaver

    Computer Software Engineer

    Satisfied Customers:

    950
    Several years of intensive programming and application development experience in various platforms.
  • http://ww2.justanswer.com/uploads/EH/ehabtutor/2012-8-2_202016_1.64x64.jpg ehabtutor's Avatar

    ehabtutor

    Computer Software Engineer

    Satisfied Customers:

    864
    Bachelor of computer science, 5+ years experience in software development, software company owner
  • http://ww2.justanswer.com/uploads/RA/rajivsharma086/2012-6-6_17128_displaypic.64x64.jpg Raj's Avatar

    Raj

    Computer Engg.

    Satisfied Customers:

    860
    BE CS, 4+ Experience in Programming and Database (ERP)
  • http://ww2.justanswer.com/uploads/eljonis/2010-01-06_130406_eljon2.jpg Eljon's Avatar

    Eljon

    Consultant

    Satisfied Customers:

    590
    11 yrs of programming (PHP, WordPress, XSL, SQL, JavaScript)
 
 
 

Related Programming Questions