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:
CD&folder name&folder name
net use &&lpt2 /delete
Del X:&folder name&folder name&print.txt
Dir X:&folder name&folder name&*.* >X:&folder name&folder name&print.txt
net use lpt2 &&server&share /persistent:yes
Print X:&folder name&folder name&print.txt /d:lpt2
Where X = drive and '&' is the back slash
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!