Link to home
Start Free TrialLog in
Avatar of Paul Tomasi
Paul TomasiFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Deskjet Printer. DOS Echo Control Character to Eject Paper.

Can the paper be ejected using DOS?

This is on an Epson inkjet printer - specifically an Eposn Stylus Photo R340.

I use a DOS batch file to output some text (about 20 lines or so) by redirecting output from a batch file to the PRN device ie.,

printsums >PRN
The problem is, when printing stops, the paper does not eject. It just remains half stuck in the printer.

So, can I add some code to my batch file to eject the remainder of the form?

I have tried the character sequence: 'ECHO [ALT-27][ALT-12] >PRN' however, this only advances the paper 1 line.

Also, I repeatedly entered the 'ECHO [ALT-27][ALT-12] >PRN' command until the paper finally ejected noting the number (54) of ECHOs required. I then placed the ECHO command insde a FOR /L-loop counting from 1..54 however, it did not advance the paper 54 times, it only advanced it 30-odd times. Could this be due to the printer's buffer not accepting the full 54 ECHO commands?
Avatar of nobus
Flag of Belgium image

Avatar of hdhondt
Flag of Australia image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I've always used CTRL-L as in ECHO ^L > PRN:
CTRL-L = 12 Decimal = 0C Hexadecimal (sorry hd) = 14 Octal
as in my link..

I goofed. FF is indeed Hex 0C
Avatar of Paul Tomasi


'echo [ALT-12]' actually does show up as 'echo FF' in Notepad++ (where 'FF' is in reverse video).

So, 'echo [ALT-12] >prn' does infact perform a formfeed however, it ejects the current sheet of paper and feeds in the next sheet ready for printing onto. I didn't want this so I settled for the following:

for  /l %%a in (1,1,40) do echo.>prn
On all accounts, I overlooked the simple 'echo.>prn' when posting the question.