Printing to a network printer from DOS

15 pts.
Tags:
DOS
Network printers
The need is to print a list of files from a folder. The list of files needs to print to a network (TCIP) shared network printer. The problem is that the (bat) file prints fine when run interactively but prints to the display when run from batch using a scheduled task. The DOS script is:
CLS
X:
CD&folder name&folder name
rem
net use &&lpt2 /delete
rem
Del X:&folder name&folder name&print.txt
rem
Dir X:&folder name&folder name&*.* >X:&folder name&folder name&print.txt
rem
net use lpt2 &&server&share /persistent:yes
rem
Print X:&folder name&folder name&print.txt /d:lpt2

Where X = drive  and  '&' is the back slash
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: