NicksonKoh
asked on
Simple Print Batch Dos Program
Hi,
I am writing a batch job that accepts a filename as input for sending to print. Code as follows :
Print.bat
=======
Print /D:"\\apbl-prn03\HP GCC 15th Floor" %1
Then I execute from dos as follows :
Print.bat "C:\Temp\Test.pdf"
The %1 parameter is not working. Am I doing this wrong? Please advise.
I am writing a batch job that accepts a filename as input for sending to print. Code as follows :
Print.bat
=======
Print /D:"\\apbl-prn03\HP GCC 15th Floor" %1
Then I execute from dos as follows :
Print.bat "C:\Temp\Test.pdf"
The %1 parameter is not working. Am I doing this wrong? Please advise.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Also, "print C:\Temp\Test.pdf" will not print as a PDF but only as the printable characters in the file. PDFs must go thru a PDF reader/formatter like Adobe Reader to print properly. I just tried it out of curiosity and it just prints a mess of characters.
About the only thing that you can print successfully from the command line like that is plain text. If you can view it in Notepad, you can print it. All other files formatted for other programs are going to be a problem.
About the only thing that you can print successfully from the command line like that is plain text. If you can view it in Notepad, you can print it. All other files formatted for other programs are going to be a problem.
ASKER
Thx. That work.
Also, there is no problem printing pdf, excel or word directly through this method.
Also, there is no problem printing pdf, excel or word directly through this method.
ASKER