Print all txt files in a folder

By | December 18, 2006

Need to print a lot of txt files quickly? Use this script and it will print all txt files from the folder of your choice to your default printer.

 ———-COPY EVERYTHING BELOW THIS LINE———- 

'This script will print all txt files in a specified folder to your default printer
'Cheyenne Harden 12.4.06

On Error Resume Next

TargetFolder = inputbox("Enter the path to the files you would like to print.")
If TargetFolder > "" Then
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(TargetFolder)
Set colItems = objFolder.Items
For Each objItem in colItems
    objItem.InvokeVerbEx("Print")
Next

Else
Wscript.Echo "No path was entered."
Wscript.Quit
End If

 

———-COPY EVERYTHING ABOVE THIS LINE———-

 

 

PLEASE MAKE SURE NO WORD WRAPPING IS HAPPENING IN YOUR SCRIPT!!!

To make this script work you will need one things!

1. You will need to have privlidges to the directory you would like to print from.

This information is provided "AS IS" with no warranties expressed or implied.

Leave a Reply

Your email address will not be published. Required fields are marked *