-
May 26th, 2005, 10:20 AM
#1
Batch file to print only 33 lines
I need help writing a batch file to load at startup and direct the dot matrix printer to print only 33 lines of the 66 lines normally on a 8 1/2 X 11 page.
I'm using a Panasonic KX-P3123 3000LE Series
I did this once before, but I forgot how I did it.
Frank
-
May 31st, 2005, 08:58 AM
#2
Are you trying to print 33 lines of a file, or trying to set the printer to 33-line mode?
If you want to print 33 lines of a file, there is no easy way to do that in DOS or using batch commands - you have to use a 3rd party utility or write a little qbasic script.
If you are just trying to send data to the printer, the easiest way is to redirect the ECHO statement.
for instance, assuming your printer is on the first parallel port:
ECHO This is a test > LPT1
Will print "This is a test" to the printer. You would have to look up the control codes for the printer to get the 33 line setting, but from that point it should be as simple as echoing the control characters into the printer.
-
May 31st, 2005, 09:20 AM
#3
Intel Mod
It does sound a bit like page length of 33 lines is required.
If so, and if the printer accepts ESC/P language, I think using Esc C 33 in ShadowWynd's suggested sequence might work.
You can create the Esc character in DOS Edit with the sequence Control P then Control [, and it will appear as a left-pointing arrow.
So the line in the batch file would be ECHO Esc C 33 > LPT1: (or PRN: in the place of LPT1: if unsure of the printer port number).
Hope I've figured this right, don't have a dot matrix set up at the moment...
-
May 31st, 2005, 05:38 PM
#4
Registered User
Originally Posted by ShadowWynd
Are you trying to print 33 lines of a file, or trying to set the printer to 33-line mode?
If you want to print 33 lines of a file, there is no easy way to do that in DOS or using batch commands - you have to use a 3rd party utility or write a little qbasic script.
It's actually not too bad with a batch file:
set count=0
FOR /F "tokens=*" %%G IN (myfile.txt) DO (call :count "%%G")
goto :eof
:count
echo %1 >> printfile.txt
set /a count+=1
if %count%==33 (
type printfile.txt
del printfile.txt
exit)
goto :eof
To print to a printer instead, replace the "type printfile.txt" with a "print printfile.txt > lpt1"
Of course there probably is an even easier way...
Similar Threads
-
By silencio in forum Networking
Replies: 2
Last Post: May 31st, 2005, 12:09 PM
-
By alistair91 in forum Windows XP
Replies: 2
Last Post: August 31st, 2004, 12:10 PM
-
By sp3tiger in forum Windows NT/2000
Replies: 3
Last Post: January 18th, 2003, 01:11 PM
-
By chaucer in forum Networking
Replies: 12
Last Post: March 21st, 2001, 10:57 AM
-
By KevinPKT in forum Windows 95/98/98SE/ME
Replies: 3
Last Post: February 8th, 2001, 10:49 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|
Bookmarks