Friday, March 12, 2010

Print all documents from a folder to default printer

This script will allow you to print multiple files ( words,Excel, pdf,etc. ) withou having to open one by one.

Create a notepad file and copy and paste this to a file.
set shApp = CreateObject("shell.application")
currentPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")
set shFolder = shApp.NameSpace( currentPath )
set files = shFolder.Items()
for each files in files

if <> Wscript.ScriptName then
' msgbox("printing "&
files.invokeverb "&Print"
end if

Save this notepad named printall.vbs or any other name just make sure you end up with .vbs

Place this new .vbs in folder and it will print everything in the folder ( not sub folders ).

No comments:

Post a Comment