First I would like to thank every one for the help with this batch file.
This is the reason that I wanted to know how to put a variable in the batch.
I wanted just a somple little rutine that I could use from an icon on my
desk top to print ascii files. I often use ascii format for work becasue any
computer can read it. (As long as it's IBM compatible) Opening programs or
fishing through explorer to print them was getting tire some.
To use this batch simply type print. Then follow the prompts. You do need
to have ansi.sys loaded in your config.sys file to see the colors. If you
want it in black and white just delete the ansi codes.
PRINT.BAT
=========================
@ECHO OFF
echo set filename=%%5>enter.bat
CLS
ECHO.
echo.
echo.
echo.
echo.
echo ^[[?7h^[[255D^[[0;1;33mEnter the name of the file to print :
echo.
fc con nul /n /lb1|date|find "1:" >tmptmp.bat
echo.
echo ^[[?7h^[[255D^[[0;1;33m How Many Copies (1-9) - Q to quit
CHOICE /C:1,2,3,4,5,6,7,8,9,Q /N /T:1,10 >nul
call tmptmp
echo %filename%
IF errorlevel 19 goto end
:A
ECHO.
ECHO ^[[?7h^[[255D^[[0;31m Printing Copy 1 of %filename%
TYPE %filename% >PRN
IF errorlevel 3 GOTO B
GOTO END
:B
ECHO ^[[?7h^[[255D^[[0;31m Printing Copy 2 of %filename%
ECHO >PRN
TYPE %filename% >PRN
IF errorlevel 5 GOTO C
GOTO END
:C
ECHO ^[[?7h^[[255D^[[0;31m Printing Copy 3 of %filename%
ECHO >PRN
TYPE %filename% >PRN
IF errorlevel 7 GOTO D
GOTO END
:D
ECHO ^[[?7h^[[255D^[[0;31m Printing Copy 4 of %filename%
ECHO >PRN
TYPE %filename% >PRN
IF errorlevel 9 GOTO E
GOTO END
:E
ECHO ^[[?7h^[[255D^[[0;31m Printing Copy 5 of %filename%
ECHO >PRN
TYPE %filename% >PRN
IF errorlevel 11 GOTO F
GOTO END
:F
ECHO ^[[?7h^[[255D^[[0;31m Printing Copy 6 of %filename%
ECHO >PRN
TYPE %filename% >PRN
IF errorlevel 13 GOTO G
GOTO END
:G
ECHO ^[[?7h^[[255D^[[0;31m Printing Copy 7 of %filename%
ECHO >PRN
TYPE %filename% >PRN
IF errorlevel 15 GOTO H
GOTO END
:H
ECHO ^[[?7h^[[255D^[[0;31m Printing Copy 8 of %filename%
ECHO >PRN
TYPE %filename% >PRN
IF errorlevel 17 GOTO I
GOTO END
:I
ECHO ^[[?7h^[[255D^[[0;31m Printing Copy 9 of %filename%
ECHO >PRN
TYPE %filename% >PRN
GOTO END
:END
for %%f in (enter tmptmp) do del %%f.bat
ECHO ^[[1;37m
... <-------- The information went data way --------
___ Blue Wave/QWK v2.12
|