here is a batch file that u can use to print a file from the command line..
PrintAny.bat, Version 1.01
Finally, a version that will print any known file type by using the associated print command from the registry.
@ECHO OFF
:: For Windows NT 4 or later only
IF NOT "%OS%"=="Windows_NT" GOTO Syntax
:: Localize variables
SETLOCAL
SET PrintCmd=
SET FileType=
:: Command line parsing
IF "%~1"=="" GOTO Syntax
IF "%~n1"=="" GOTO Syntax
IF "%~x1"=="" GOTO Syntax
SET File2Print=%~1
ECHO.%File2Print% ¦ FIND "?" >NUL
IF NOT ERRORLEVEL 1 GOTO Syntax
IF NOT EXIST "%File2Print%" GOTO Syntax
:: Strip quotes from TEMP variable
SET TEMP=%TEMP:"=%
:: Get the file association from the registry
FOR /F "tokens=3*" %%A IN ('REG.EXE QUERY "HKEY_CLASSES_ROOT\%~x1" /ve') DO SET FileType=%%B
SET Filetype=%FileType:"=%
:: Get the print command for this file type from the registry
FOR /F "tokens=3*" %%A IN ('REG.EXE QUERY "HKEY_CLASSES_ROOT\%FileType%\shell\print\command" /ve') DO SET PrintCmd=%%B
:: If no default was found, then the file type is probably unknown in Windows
IF NOT DEFINED PrintCmd GOTO NoAssoc
SET PrintCmd=%PrintCmd:\"="%
SET PrintCmd=%PrintCmd:""="%
SET PrintCmd=%PrintCmd:\\=\%
:: Next line enables long file names, added by Michael Lintner
SET PrintCmd=%PrintCmd:"%1"=%%1%
:: Actual print command has to be stored in a temporary batch file,
:: which is used as the batch language's "eval" substitute
> "%TEMP%.\~PrintAny.bat" ECHO START "Print" %PrintCmd%
CALL "%TEMP%.\~PrintAny.bat"
:: Cleanup
DEL "%TEMP%.\~PrintAny*.*"
:: Done
GOTO End
:NoAssoc
ECHO.
ECHO Sorry, this batch file works only for known file types with associated
ECHO print commands defined in the registry hive HKEY_CLASSES_ROOT.
:Syntax
ECHO.
ECHO PrintAny.bat, Version 1.01 for Windows NT 4 / 2000
ECHO Prints any known file type from the command line
ECHO.
ECHO Usage: PRINTANY file_to_print
ECHO.
ECHO Where: "file_to_print" is the name of the file to be printed.
ECHO.
ECHO Notes: This batch file works only if the file type's print command
ECHO is defined in the registry hive HKEY_CLASSES_ROOT.
ECHO This batch file requires REG.EXE, which is native in Windows
ECHO 2000 and later, or part of the Windows NT 4 Resource Kit.
ECHO Idea inspired by Eric Grux.
ECHO Modification to enable long file names by Michael Lintner.
ECHO.
ECHO Written by Rob van der Woude
ECHO
:End
IF "%OS%"=="Windows_NT" ENDLOCAL
~~~~~~~~~~~~~~~~~~~
Here is what needs to be done.. We need to make 2 batch out of the one that i pasted above. One for each printer. Then a third file can be made which simply run the batch file for printer A and printer B .
R you with me ???
-
mobajwa
After the game ,the king and the pawn , both go in the same box.