|
|
|
date: Mon, 07 Jan 2008 18:08:37 +0000,
group: uk.comp.misc
back
Printing to USB port instead of LPT1
I have a 16-bit DOS programme that I wrote many years ago using MS
QuickBasic, and that I use only occasionally. It outputs to a printer
using the LPRINT command, which according to the 'Help' file sends
data to LPT1. This worked perfectly satisfactorily on my old computer
(running Win-ME), which had the printer connected to the parallel
port, LPT1, as was standard for many years.
But my new computer (running Win-XP), doesn't have a parallel port and
the printer (same printer, HP Deskjet 5550) is now connected to a USB
port, and my programme refuses to print. If I go into 'Printers and
Faxes', select my printer and click on the 'Ports' tab, it tells me
that documents will print to the first free checked port and that this
is the USB virtual printer port, which is what I would expect.
So why isn't the print data from my programme being routed to the USB
port? WORD and HTML documents and JPG images all print perfectly
normally, as I would expect. I've tried 'Enable Printer Pooling' and
checking the LPT1 box in addition to the USB printer port above, but
that doesn't help. Is there anything under the 'Advanced' tab for my
printer properties that I should be checking, or any other system
tweaks I could try?
Might the problem be that the QuickBasic LPRINT command sends data
directly to LPT1, by-passing any Windows settings? If I try to run a
simple 1-line programme such as LPRINT "this is a printer test",
QuickBasic throws up an error 'Device Fault'. Is there a solution
other than getting a more up-to-date version of QuickBasic (mine is
Version 4, mid 1980's or thereabouts!), or a parallel printer card
configured as LPT1, neither of which I am keen to do?
--
Chris
E-mail: christopher[dot]hogg[at]virgin[dot]net
date: Mon, 07 Jan 2008 18:08:37 +0000
author: Chris Hogg
|
Re: Printing to USB port instead of LPT1
"Chris Hogg" wrote in message
news:6bq4o39d8veqvju36r0jjvug4t7lrmu2ea@4ax.com...
>I have a 16-bit DOS programme that I wrote many years ago using MS
> QuickBasic, and that I use only occasionally. It outputs to a printer
> using the LPRINT command, which according to the 'Help' file sends
> data to LPT1. This worked perfectly satisfactorily on my old computer
> (running Win-ME), which had the printer connected to the parallel
> port, LPT1, as was standard for many years.
>
> But my new computer (running Win-XP), doesn't have a parallel port and
> the printer (same printer, HP Deskjet 5550) is now connected to a USB
> port, and my programme refuses to print. If I go into 'Printers and
> Faxes', select my printer and click on the 'Ports' tab, it tells me
> that documents will print to the first free checked port and that this
> is the USB virtual printer port, which is what I would expect.
>
> So why isn't the print data from my programme being routed to the USB
> port? WORD and HTML documents and JPG images all print perfectly
> normally, as I would expect. I've tried 'Enable Printer Pooling' and
> checking the LPT1 box in addition to the USB printer port above, but
> that doesn't help. Is there anything under the 'Advanced' tab for my
> printer properties that I should be checking, or any other system
> tweaks I could try?
>
> Might the problem be that the QuickBasic LPRINT command sends data
> directly to LPT1, by-passing any Windows settings? If I try to run a
> simple 1-line programme such as LPRINT "this is a printer test",
> QuickBasic throws up an error 'Device Fault'. Is there a solution
> other than getting a more up-to-date version of QuickBasic (mine is
> Version 4, mid 1980's or thereabouts!), or a parallel printer card
> configured as LPT1, neither of which I am keen to do?
>
>
> --
Run your program (notice the American spelling!) and then check for an
output file. What has it done? Spooled it to some Windows-recognized
device? At all events, if you run a Search using "all files" created on
today's date, it should show up.
From there you can trace back.
If you end up finding that you've created a print-file that just sits
there (probably awaiting some event that isn't happening), well, that's
a great point to recommence from.
Ed
date: Mon, 7 Jan 2008 19:08:51 -0000
author: Ed Cryer
|
Re: Printing to USB port instead of LPT1
On Mon, 07 Jan 2008 18:08:37 +0000, Chris Hogg wrote:
>I have a 16-bit DOS programme that I wrote many years ago using MS
>QuickBasic, and that I use only occasionally. It outputs to a printer
>using the LPRINT command, which according to the 'Help' file sends
>data to LPT1. This worked perfectly satisfactorily on my old computer
>(running Win-ME), which had the printer connected to the parallel
>port, LPT1, as was standard for many years.
>
>But my new computer (running Win-XP), doesn't have a parallel port and
>the printer (same printer, HP Deskjet 5550) is now connected to a USB
>port, and my programme refuses to print. If I go into 'Printers and
>Faxes', select my printer and click on the 'Ports' tab, it tells me
>that documents will print to the first free checked port and that this
>is the USB virtual printer port, which is what I would expect.
>
>So why isn't the print data from my programme being routed to the USB
>port? WORD and HTML documents and JPG images all print perfectly
>normally, as I would expect. I've tried 'Enable Printer Pooling' and
>checking the LPT1 box in addition to the USB printer port above, but
>that doesn't help. Is there anything under the 'Advanced' tab for my
>printer properties that I should be checking, or any other system
>tweaks I could try?
>
>Might the problem be that the QuickBasic LPRINT command sends data
>directly to LPT1, by-passing any Windows settings? If I try to run a
>simple 1-line programme such as LPRINT "this is a printer test",
>QuickBasic throws up an error 'Device Fault'. Is there a solution
>other than getting a more up-to-date version of QuickBasic (mine is
>Version 4, mid 1980's or thereabouts!), or a parallel printer card
>configured as LPT1, neither of which I am keen to do?
If you must use that programme, get a USB to parallel converter:
http://www.micom.co.uk/products.asp?partno=ACCMICUSB1A-PAR
Around £8.
--
Jock McSporran of McSporran
date: Mon, 07 Jan 2008 21:01:57 +0000
author: Afton
|
Re: Printing to USB port instead of LPT1
Afton wrote:
> On Mon, 07 Jan 2008 18:08:37 +0000, Chris Hogg wrote:
>
>
>>I have a 16-bit DOS programme that I wrote many years ago using MS
>>QuickBasic, and that I use only occasionally. It outputs to a printer
>>using the LPRINT command, which according to the 'Help' file sends
>>data to LPT1. This worked perfectly satisfactorily on my old computer
>>(running Win-ME), which had the printer connected to the parallel
>>port, LPT1, as was standard for many years.
>>
>>But my new computer (running Win-XP), doesn't have a parallel port and
>>the printer (same printer, HP Deskjet 5550) is now connected to a USB
>>port, and my programme refuses to print.
I would be interested in how you use XP to work in DOS mode here. I am
not saying that it can't be done, it's just that I have never tried it
and I am a firm believer that it can be done.
>> If I go into 'Printers and
>>Faxes', select my printer and click on the 'Ports' tab, it tells me
>>that documents will print to the first free checked port and that this
>>is the USB virtual printer port, which is what I would expect.
>>
>>So why isn't the print data from my programme being routed to the USB
>>port? WORD and HTML documents and JPG images all print perfectly
>>normally, as I would expect.
If you look on your keyboard at the top right, you will see a key that
is marked Print Scrn. Back in the old days, this printed out what you
saw on the screen. With XP it just puts what is on the screen to the
paste board. Is this anything to do with it?
>> I've tried 'Enable Printer Pooling' and
>>checking the LPT1 box in addition to the USB printer port above, but
>>that doesn't help. Is there anything under the 'Advanced' tab for my
>>printer properties that I should be checking, or any other system
>>tweaks I could try?
>>
>>Might the problem be that the QuickBasic LPRINT command sends data
>>directly to LPT1, by-passing any Windows settings? If I try to run a
>>simple 1-line programme such as LPRINT "this is a printer test",
>>QuickBasic throws up an error 'Device Fault'. Is there a solution
>>other than getting a more up-to-date version of QuickBasic (mine is
>>Version 4, mid 1980's or thereabouts!), or a parallel printer card
>>configured as LPT1, neither of which I am keen to do?
>
>
> If you must use that programme, get a USB to parallel converter:
>
> http://www.micom.co.uk/products.asp?partno=ACCMICUSB1A-PAR
>
> Around £8.
I thought about answering like that, but how do you get DOS to talk to a
USB port? It wasn't possible until win 95.
Surely you would want a parallel card to make this work and even then I
doubt it will, as XP will channel the print to where it 'thinks' it
should be.
Educate me, someone please.
Dave
date: Mon, 07 Jan 2008 23:01:17 +0000
author: Dave
|
Re: Printing to USB port instead of LPT1
On Mon, 07 Jan 2008 18:08:37 +0000, Chris Hogg
wrote the following to uk.comp.misc:
> I have a 16-bit DOS programme that I wrote many years ago using MS
> QuickBasic, and that I use only occasionally. It outputs to a printer
> using the LPRINT command, which according to the 'Help' file sends
> data to LPT1. This worked perfectly satisfactorily on my old computer
> (running Win-ME), which had the printer connected to the parallel
> port, LPT1, as was standard for many years.
>
> But my new computer (running Win-XP), doesn't have a parallel port and
> the printer (same printer, HP Deskjet 5550) is now connected to a USB
> port, and my programme refuses to print. If I go into 'Printers and
> Faxes', select my printer and click on the 'Ports' tab, it tells me
> that documents will print to the first free checked port and that this
> is the USB virtual printer port, which is what I would expect.
The trick is to capture output to LPT1 to a network printer.
http://support.microsoft.com/kb/314499 has details on how to do it. Even if
you're not on a network you can still share the printer as if it was a
network device.
mh.
--
http://www.nukesoft.co.uk
http://personal.nukesoft.co.uk
From address is a blackhole. Reply-to address is valid.
date: 8 Jan 2008 00:19:07 GMT
author: Marcus Houlden
|
Re: Printing to USB port instead of LPT1
On Mon, 07 Jan 2008 23:01:17 +0000, Dave wrote:
>Afton wrote:
>
>> On Mon, 07 Jan 2008 18:08:37 +0000, Chris Hogg wrote:
>I would be interested in how you use XP to work in DOS mode here. I am
>not saying that it can't be done, it's just that I have never tried it
>and I am a firm believer that it can be done.
I don't know about the OP, but I have quite a few DOS applications which
I have been using at XP's command prompt for years. I am not using a
virtual machine.
Even my old MSDOS Q-Edit and LIST.COM work well. I do quite a bit of
file copying, erasing, moving etc at the command prompt as it's much
faster than using the cumbersome drag-and-drop of the GUI.
Printing is another matter. Although I have a parallel port built in,
my printer is a USB only device. But had I a parallel printer connected,
I have little doubt that it could be used with something like
C:\>type testfile.txt>LPT1
or
C:\>dir c:\utils>LPT1
>> If you must use that programme, get a USB to parallel converter:
>>
>> http://www.micom.co.uk/products.asp?partno=ACCMICUSB1A-PAR
>>
>> Around £8.
>
>I thought about answering like that, but how do you get DOS to talk to a
>USB port? It wasn't possible until win 95.
I had assumed that this device converted the parallel port output to
USB.
In any case, Marcus gives a better solution further down the thread.
--
Jock McSporran of McSporran
date: Tue, 08 Jan 2008 13:58:24 +0000
author: Afton
|
Re: Printing to USB port instead of LPT1
Many thanks for the suggestions.
In reply to Dave, I didn't do anything unusual to get the programme to
run under XP. It's a compiled programme and I just copied it across
from the old computer and drag-and-dropped a short-cut onto the
desktop, and it ran from there without further ado.
Thanks especially to Marcus for the link. I'm not on a network, it's a
stand-alone computer and printer, and you say I can still share the
printer as if it was a network device.
The instructions on the link say to use NET.EXE . I take it from your
comment that not being on a network won't matter. But I'm uncertain
about the detail (I could cope with simple Basic programmes a few
decades ago, but I'm a bit of a dummy when it comes to the modern
stuff!).
At a command prompt, in general it says one should type:
net use lpt1 \\pserver\laser1 /persistent:yes
where pserver is the print server name and laser1 is the printer name.
As I have no network printer server, I assume I simply replace
'pserver' with my local print server name, which apparently is
YOUR-01A7BB57C3 according to the info on 'Printers and Faxes'. Does
that look sensible?
The computer seems to give my printer the name 'hp deskjet 5550
series' which is presumably the name I give in place of laser1.
So at a guess I would use
net use lpt1 \\YOUR-01A7BB57C3\hp deskjet 5550 series /persistent:yes
Does that look OK?
Will this be a permanent change surviving switch-offs etc. or will it
just last for the session, do you know? (I assume 'persistent:yes'
means it's permanent).
And if I make a pig's-ear of it and it all goes wrong (I speak from
bitter experience!), how do I undo or edit the statement? In days of
old, it's the sort of thing that went into the autoexec.bat file and
was easily edited, but that seems to be a thing of the past. Does it
go into NET.EXE and if so, is it editable?
--
Chris
E-mail: christopher[dot]hogg[at]virgin[dot]net
date: Tue, 08 Jan 2008 22:14:38 +0000
author: Chris Hogg
|
Re: Printing to USB port instead of LPT1
Chris Hogg wrote:
> Many thanks for the suggestions.
>
> In reply to Dave, I didn't do anything unusual to get the programme to
> run under XP. It's a compiled programme
Ah, a compiled prog, I never thought about that :-(
Many thanks
Dave
date: Tue, 08 Jan 2008 22:31:26 +0000
author: Dave
|
Re: Printing to USB port instead of LPT1
On Tue, 08 Jan 2008 22:14:38 +0000, Chris Hogg
wrote the following to uk.comp.misc:
> Many thanks for the suggestions.
>
> In reply to Dave, I didn't do anything unusual to get the programme to
> run under XP. It's a compiled programme and I just copied it across
> from the old computer and drag-and-dropped a short-cut onto the
> desktop, and it ran from there without further ado.
>
> Thanks especially to Marcus for the link. I'm not on a network, it's a
> stand-alone computer and printer, and you say I can still share the
> printer as if it was a network device.
>
> The instructions on the link say to use NET.EXE . I take it from your
> comment that not being on a network won't matter. But I'm uncertain
> about the detail (I could cope with simple Basic programmes a few
> decades ago, but I'm a bit of a dummy when it comes to the modern
> stuff!).
>
> At a command prompt, in general it says one should type:
> net use lpt1 \\pserver\laser1 /persistent:yes
> where pserver is the print server name and laser1 is the printer name.
>
> As I have no network printer server, I assume I simply replace
> 'pserver' with my local print server name, which apparently is
> YOUR-01A7BB57C3 according to the info on 'Printers and Faxes'. Does
> that look sensible?
>
> The computer seems to give my printer the name 'hp deskjet 5550
> series' which is presumably the name I give in place of laser1.
>
> So at a guess I would use
> net use lpt1 \\YOUR-01A7BB57C3\hp deskjet 5550 series /persistent:yes
> Does that look OK?
\\server_name is the "network" name of your computer. Change it by right
clicking my computer and then properties/computer name. MS goes for an auto
generated name when you install XP (or Vista) but you can change it to
something else. To set the printer name, go to Control Panel/Printers and
Faxes and right click the printer. Go to Properties and then the sharing
tab. Chances are there's no name there so you'll need to enter one. My own
printer is shared as \\neutron\beta. (Alpha is my ancient Canon BJC-250.
It's currently sitting unused in a cupboard and I might put it on ebay if I
ever get round to it). The share names can use spaces but it's probably
easier if you don't.
> Will this be a permanent change surviving switch-offs etc. or will it
> just last for the session, do you know? (I assume 'persistent:yes'
> means it's permanent).
This survives logins, so it stays.
> And if I make a pig's-ear of it and it all goes wrong (I speak from
> bitter experience!), how do I undo or edit the statement? In days of
> old, it's the sort of thing that went into the autoexec.bat file and
> was easily edited, but that seems to be a thing of the past. Does it
> go into NET.EXE and if so, is it editable?
It gets stored somewhere in the registry. Delete it with something like:
NET USE LPT1 \\neutron\beta /DELETE
mh.
--
http://www.nukesoft.co.uk
http://personal.nukesoft.co.uk
From address is a blackhole. Reply-to address is valid.
date: 9 Jan 2008 00:28:13 GMT
author: Marcus Houlden
|
Re: Printing to USB port instead of LPT1
In uk.comp.misc message ,
Tue, 8 Jan 2008 13:58:24, Afton posted:
>Even my old MSDOS Q-Edit and LIST.COM work well. I do quite a bit of
>file copying, erasing, moving etc at the command prompt as it's much
>faster than using the cumbersome drag-and-drop of the GUI.
>
>Printing is another matter. Although I have a parallel port built in,
>my printer is a USB only device. But had I a parallel printer connected,
>I have little doubt that it could be used with something like
>
>C:\>type testfile.txt>LPT1
>or
>C:\>dir c:\utils>LPT1
>
PRINTEXT, via sig line 3 when the server's up, accepts ordinary DOS text
and sends it to the Windows printer :
dir /b scr*.* | PRINTEXT /C4
will list the filenames of all files matching scr*.* in a 4-column
format.
--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk DOS 3.3, 6.20; WinXP.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms & links.
PAS EXE TXT ZIP via <URL:http://www.merlyn.demon.co.uk/programs/00index.htm>
My DOS <URL:http://www.merlyn.demon.co.uk/batfiles.htm> - also batprogs.htm.
date: Tue, 8 Jan 2008 21:32:05 +0000
author: Dr J R Stockton
|
Re: Printing to USB port instead of LPT1
On Tue, 8 Jan 2008 21:32:05 +0000, Dr J R Stockton
wrote:
>In uk.comp.misc message ,
>Tue, 8 Jan 2008 13:58:24, Afton posted:
>>Even my old MSDOS Q-Edit and LIST.COM work well. I do quite a bit of
>>file copying, erasing, moving etc at the command prompt as it's much
>>faster than using the cumbersome drag-and-drop of the GUI.
>>
>>Printing is another matter. Although I have a parallel port built in,
>>my printer is a USB only device. But had I a parallel printer connected,
>>I have little doubt that it could be used with something like
>>
>>C:\>type testfile.txt>LPT1
>>or
>>C:\>dir c:\utils>LPT1
>>
>
>PRINTEXT, via sig line 3 when the server's up, accepts ordinary DOS text
>and sends it to the Windows printer :
>
> dir /b scr*.* | PRINTEXT /C4
>
>will list the filenames of all files matching scr*.* in a 4-column
>format.
Thanks for that. Got the .ZIP version. The .EXE link gives a 404
error.
--
Jock McSporran of McSporran
date: Wed, 09 Jan 2008 18:08:05 +0000
author: Afton
|
Re: Printing to USB port instead of LPT1
On 9 Jan 2008 00:28:13 GMT, Marcus Houlden
wrote:
>\\server_name is the "network" name of your computer. Change it by right
>clicking my computer and then properties/computer name. MS goes for an auto
>generated name when you install XP (or Vista) but you can change it to
>something else. To set the printer name, go to Control Panel/Printers and
>Faxes and right click the printer. Go to Properties and then the sharing
>tab. Chances are there's no name there so you'll need to enter one. My own
>printer is shared as \\neutron\beta. (Alpha is my ancient Canon BJC-250.
>It's currently sitting unused in a cupboard and I might put it on ebay if I
>ever get round to it). The share names can use spaces but it's probably
>easier if you don't.
>
>> Will this be a permanent change surviving switch-offs etc. or will it
>> just last for the session, do you know? (I assume 'persistent:yes'
>> means it's permanent).
>
>This survives logins, so it stays.
>
>> And if I make a pig's-ear of it and it all goes wrong (I speak from
>> bitter experience!), how do I undo or edit the statement? In days of
>> old, it's the sort of thing that went into the autoexec.bat file and
>> was easily edited, but that seems to be a thing of the past. Does it
>> go into NET.EXE and if so, is it editable?
>
>It gets stored somewhere in the registry. Delete it with something like:
>NET USE LPT1 \\neutron\beta /DELETE
>
>mh.
Thanks for all that, which I've done. When I clicked on the sharing
tab in the properties for my printer, I was presented with two
options. One was to go through the whole rigmarole of setting up a
network, the other merely to allow printer sharing. I chose the
latter, and then it asked me for the printer name, which I gave it. I
also changed the computer name to something a little more
intelligible, and reset the Windows firewall to allow printer sharing,
followed by a re-boot. (I don't normally have the Win Firewall
activated as I use another AV/Firewall system).
But when I do the START > RUN > cmd <enter> and type in the net use
lpt1 instruction, using the new computer and printer name, I get an
error message: System Error 1231 The network location cannot be
reached.
Any suggestions? Should I have gone through the rigmarole of
pretending to set up a network? (I hope not. It looks a nightmare if I
haven't actually got a network to set up!) Should I have reset
anything to do with Workgroup when changing the computer name?
--
Chris
E-mail: christopher[dot]hogg[at]virgin[dot]net
date: Wed, 09 Jan 2008 21:33:16 +0000
author: Chris Hogg
|
Re: Printing to USB port instead of LPT1
In uk.comp.misc message ,
Wed, 9 Jan 2008 18:08:05, Afton posted:
>On Tue, 8 Jan 2008 21:32:05 +0000, Dr J R Stockton
>wrote:
>>PRINTEXT, via sig line 3 when the server's up, accepts ordinary DOS text
>>and sends it to the Windows printer :
>>
>> dir /b scr*.* | PRINTEXT /C4
>>
>>will list the filenames of all files matching scr*.* in a 4-column
>>format.
>
>Thanks for that. Got the .ZIP version. The .EXE link gives a 404
>error.
Yes, I had to save space. I usually (?) remember to advise the ZIP.
Apologies.
--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6.
Web <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.
date: Wed, 9 Jan 2008 23:11:13 +0000
author: Dr J R Stockton
|
Re: Printing to USB port instead of LPT1
On Wed, 9 Jan 2008 23:11:13 +0000, Dr J R Stockton
wrote:
>In uk.comp.misc message ,
>Wed, 9 Jan 2008 18:08:05, Afton posted:
>>On Tue, 8 Jan 2008 21:32:05 +0000, Dr J R Stockton
>>wrote:
>
>>>PRINTEXT, via sig line 3 when the server's up, accepts ordinary DOS text
>>>and sends it to the Windows printer :
>>>
>>> dir /b scr*.* | PRINTEXT /C4
>>>
>>>will list the filenames of all files matching scr*.* in a 4-column
>>>format.
>>
>>Thanks for that. Got the .ZIP version. The .EXE link gives a 404
>>error.
>
>Yes, I had to save space. I usually (?) remember to advise the ZIP.
>Apologies.
No need to apologise.
It works!
--
Jock McSporran of McSporran
date: Thu, 10 Jan 2008 20:14:06 +0000
author: Afton
|
Re: Printing to USB port instead of LPT1
In uk.comp.misc message ,
Thu, 10 Jan 2008 20:14:06, Afton posted:
>>>>PRINTEXT, via sig line 3 when the server's up, accepts ordinary DOS text
>>>>and sends it to the Windows printer :
>It works!
I did toy with the idea of adding an option that would print the first
page in portrait orientation on the left-hand half of the sheet of paper
considered in landscape orientation, then the next page as portrait on
the left-hand half of the remainder as landscape, then ... ... . Every
document would then fit on a single sheet, with the pages successively
being A5, A6, A7, A8, ... .
--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk DOS 3.3, 6.20; WinXP.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms & links.
PAS EXE TXT ZIP via <URL:http://www.merlyn.demon.co.uk/programs/00index.htm>
My DOS <URL:http://www.merlyn.demon.co.uk/batfiles.htm> - also batprogs.htm.
date: Fri, 11 Jan 2008 12:23:58 +0000
author: Dr J R Stockton
|
|
|