'This VBscript will print all PDF files in the C:\files\to_be_printed\ folder. It requires a PDF application that
'supports silent printing. Sumatra is main one I use. It will print one file every 15 seconds, then move
'all the files to the C:\files\printed\ folder. These paths may of course be changed within the script.
Set fso=CreateObject("Scripting.FileSystemObject")
source="C:\files\to_be_printed\"
target="C:\files\temp\"
printed="C:\files\printed\"
Set fldr=fso.getFolder(source)
for each file in fldr.files
if right(lcase(file.name),4)=".pdf" then
call mover(lcase(file.path))
end if
next
sub mover(f1)
fso.MoveFile f1,target
end sub
strComputer = "."
TargetFolder = "C:\files\temp"
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(TargetFolder)
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set colItems = objFolder.Items
For i = 0 to colItems.Count - 1
colItems.Item(i).InvokeVerbEx("Print")
wscript.sleep 15000
Next
wscript.sleep 120000
Set fldr=fso.getFolder(target)
for each file in fldr.files
if right(lcase(file.name),4)=".pdf" then
call mover2(lcase(file.path))
end if
next
sub mover2(f1)
fso.MoveFile f1,printed
end sub
Comments