0

So far i got the part of auto print.

I need to keep the script running in the back, to look for any .pdf that it can find on a targeted folder for example "downloads", that way whenever i download a .pdf, it will print it and then delete the file.

TargetFolder = "\\USER\FOLDER" 
Set objShell = CreateObject("Shell.Application") 
Set objFolder = objShell.Namespace(TargetFolder) 
Set colItems = objFolder.Items 
For Each objItem In colItems 
objItem.InvokeVerbEx ("Print") 
Next
user692942
  • 16,398
  • 7
  • 76
  • 175
Sabi Tech
  • 81
  • 1
  • 12
  • You could just use Task Schedular to run the script to a schedule of your choosing. – user692942 Apr 26 '17 at 22:55
  • @Lankymart i couldnt find in what part they address the print then delete code. – Sabi Tech Apr 26 '17 at 23:36
  • You have your code I was simply pointing you to how to run it in a scheduled fashion that means it doesn't have to constantly run in some low performant over complex scripted loop. If your missing the delete part of the script, this can be accomplished easily with the `FileSystemObject`. You'll will find plenty of existing questions that cover this in detail. – user692942 Apr 26 '17 at 23:38
  • Here is a [good example](http://stackoverflow.com/q/9012529/692942) of question that deals with deleting files using the `FileSystemObject`. If you came here posting a question expecting it to be written for you, than you came to the wrong place. – user692942 Apr 26 '17 at 23:44
  • @Lankymart On the contrary my friend, thanks for all the help, when you help a user many benefit from a question answered in the long run, since users can see a consolidated and functional example. good day. – Sabi Tech Apr 27 '17 at 00:10
  • Wow I was posting the working code and it is closed, bad luck. – Tehscript Apr 27 '17 at 00:24
  • Not when it's a duplicate or composite of multiple questions that have already been answered. Please review [ask] before posting. – user692942 Apr 27 '17 at 01:06

0 Answers0