Show pageBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Print All File in a Directory ====== Assume your put this vbs named ''YOUR_VBS_NAME.vbs'' in a directory that only has the files your want to print, and nothing more. It is good for printing massive of MS DOC files. <code> Dim WshShell Set WshShell = CreateObject("WScript.Shell") Dim sCurPath sCurPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".") TargetFolder = sCurPath Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.Namespace(TargetFolder) Set colItems = objFolder.Items Dim count count = colItems.Count - 1 Dim processed processed = 0 For Each item in colItems If InStr(item.NAME,"YOUR_VBS_NAME.vbs") = 0 Then processed = processed + 1 item.InvokeVerbEx("Print") WshShell.Popup processed & " of " & count & " items processed", 5, "THE_DIALOG_BOX_TITLE" End If Next </code> This script will run the print command every five seconds. That 5 seconds is needed! It is because opening ms office too fast will make office crash. vbscript/print_all_files_in_a_directory.txt Last modified: 2018/10/16 10:02by chongtin