August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!
'Receive command line arguments set args = WScript.Arguments num = args.Count if num = 0 then WScript.Echo "There is no document to print!" WScript.Quit 1 end if 'Print each document using MS Word for k = 0 to num - 1 Set objWord = CreateObject("Word.Application") Set objDoc = objWord.Documents.Open("C:\" & args.Item(k)) objDoc.PrintOut objWord.Quit next Wscript.Sleep 25000 'Delete temporary files from local drive for k = 0 to num - 1 Set fso = CreateObject("Scripting.FileSystemObject") Set aFile = fso.GetFile("C:\" & args.Item(k)) aFile.Delete next
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.