How to print to both file and paper in MS-DOS?
How to print to both file and paper in MS-DOS?
I've spent the hole day with this "caprice".
Thou it's very easy to do it in *nix, unfortunately I need it in Windows.
I'd like to have everything that is printed in a dot matrix printer (that hangs from a Win XP) to be printed in paper AND printed to a file. It's some kind of back-up of what it's printed.
The software is a good old DOS program which does not have the option to choose where to print, but it easy to redirect the printing to a file with SET PRINTER=
But I want both, file and paper.
Any ideas?
Thanks.
Thou it's very easy to do it in *nix, unfortunately I need it in Windows.
I'd like to have everything that is printed in a dot matrix printer (that hangs from a Win XP) to be printed in paper AND printed to a file. It's some kind of back-up of what it's printed.
The software is a good old DOS program which does not have the option to choose where to print, but it easy to redirect the printing to a file with SET PRINTER=
But I want both, file and paper.
Any ideas?
Thanks.
Remember: [b][i]"pecunia pecuniam parere non potest"[/i][/b]
As I recall, the DOS Editor has the option to print to an LPT port or print to file.
Regarding the DOS Editor, the ones that come with Windows 95 and 98 are better editors than the earlier ones.
The pre Windows 95 DOS also has a utility called PRINT. I forgot about it. But the HELP utility should educate on the basics.
Regarding the DOS Editor, the ones that come with Windows 95 and 98 are better editors than the earlier ones.
The pre Windows 95 DOS also has a utility called PRINT. I forgot about it. But the HELP utility should educate on the basics.
I couldn't be sure about a DOS version, but there's probably system-administrator software that'll let you automatically log a binary file copy of anything sent to the printer on the network. All you'd have to do would be to set it up for a single-system "network."
[ Puppy 4.3.1 JP, Frugal install ] * [ XenialPup 7.5, Frugal install ] * [XenialPup 64 7.5, Frugal install] * [ 4GB RAM | 512MB swap ]
In memory of our beloved American Eskimo puppy (1995-2010) and black Lab puppy (1997-2011).
In memory of our beloved American Eskimo puppy (1995-2010) and black Lab puppy (1997-2011).
re: Printing to file and paper (in MS-DOS)
It might help if we know the name of the DOS program, or at least the programming language of its source code.
The thought that immediately crosses my mind is redirect printer to file, then print file.
However, I'm sure there are some reasons that won't work.
Off the top of my head, you'd probably need to empty and backup the file every print, and you'd have a rather complex/cludgy setup.
General form of what I'm thinking about (mind you, this is from a guy who hasn't really used DOS/Windows for 5-6 years):
However, I'm sure there are some reasons that won't work.
Off the top of my head, you'd probably need to empty and backup the file every print, and you'd have a rather complex/cludgy setup.
General form of what I'm thinking about (mind you, this is from a guy who hasn't really used DOS/Windows for 5-6 years):
Code: Select all
#assuming PRINTER=prnfile.txt
PRNFILE=prnfile.txt
print %PRNFILE%
type %PRNFILE% >>prnsave.txt
del %PRNFILE%
Thanks all for your answers.
With more googling, I've found this tool:
http://leelusoft.blogspot.com.ar/p/watc ... er-25.html
which seems of help, I´ve to think it a bit more.
The program in question it´s my billing software I use at my pharmacy. It´s written in COBOL. It´s closed software, I can ask the programer for new functionalities if they ´re really needed, but this it´s not the case.
I must confess that the original idea is not having to walk (aprox 12 mts) to get the printed paper in a PC in other room if I can see the content of a file trough the LAN.
Also, it´s not a bad idea to have a file copy since sometimes the paper gets stuck and doesn´t print at all.
Thanks again.
Saludos.
With more googling, I've found this tool:
http://leelusoft.blogspot.com.ar/p/watc ... er-25.html
which seems of help, I´ve to think it a bit more.
The program in question it´s my billing software I use at my pharmacy. It´s written in COBOL. It´s closed software, I can ask the programer for new functionalities if they ´re really needed, but this it´s not the case.
I must confess that the original idea is not having to walk (aprox 12 mts) to get the printed paper in a PC in other room if I can see the content of a file trough the LAN.
Also, it´s not a bad idea to have a file copy since sometimes the paper gets stuck and doesn´t print at all.
Thanks again.
Saludos.
Remember: [b][i]"pecunia pecuniam parere non potest"[/i][/b]
re: How to print to both file and paper in MS-DOS?
Perhaps this page may provide clues:
http://ss64.com/nt/syntax-redirection.html
commandA && commandB Run commandA, if it succeeds then run commandB
echo "June_statements printing failed" > D:\June_log.txt && print_monthly.exe June_statements.xls && echo "June_statements printing succeeded" > D:\June_log.txt
and/or maybe this page
https://technet.microsoft.com/en-us/lib ... 90909.aspx
for % in (June_statements July_statements) do print_monthly.exe %.xls && echo "%.xls printing succeeded" > D:\%-success.txt
Sorry, my DOS is awfully rusty. Maybe something like
LPT1 < print_monthly.exe June-billings.xls > D:\June-logfile.txt
might work.
Another page:
http://stackoverflow.com/questions/7119 ... atch-files
You can also create a "generic/text only" printer in Windows and maybe print to that
print_monthly.exe June-billings.xls LPT1 && print_monthly.exe June-billings.xls PRN_GENERIC
http://ss64.com/nt/syntax-redirection.html
commandA && commandB Run commandA, if it succeeds then run commandB
echo "June_statements printing failed" > D:\June_log.txt && print_monthly.exe June_statements.xls && echo "June_statements printing succeeded" > D:\June_log.txt
and/or maybe this page
https://technet.microsoft.com/en-us/lib ... 90909.aspx
for % in (June_statements July_statements) do print_monthly.exe %.xls && echo "%.xls printing succeeded" > D:\%-success.txt
Sorry, my DOS is awfully rusty. Maybe something like
LPT1 < print_monthly.exe June-billings.xls > D:\June-logfile.txt
might work.
Another page:
http://stackoverflow.com/questions/7119 ... atch-files
You can also create a "generic/text only" printer in Windows and maybe print to that
print_monthly.exe June-billings.xls LPT1 && print_monthly.exe June-billings.xls PRN_GENERIC
- Moose On The Loose
- Posts: 965
- Joined: Thu 24 Feb 2011, 14:54
Re: How to print to both file and paper in MS-DOS?
Back in the mists of time, the easy way to make a program that did this was to capture the interrupt vector for printing. A little TSR[1] program would take over handling of bytes sent to the printer.Galbi wrote:I've spent the hole day with this "caprice".
Thou it's very easy to do it in *nix, unfortunately I need it in Windows.
I'd like to have everything that is printed in a dot matrix printer (that hangs from a Win XP) to be printed in paper AND printed to a file. It's some kind of back-up of what it's printed.
The software is a good old DOS program which does not have the option to choose where to print, but it easy to redirect the printing to a file with SET PRINTER=
But I want both, file and paper.
Any ideas?
Thanks.
A better option for today may be to run the DOS program under dosemu on a Linux box. This way the DOS program will see a faked printer,
[1] Terminate and Stay Resident