Automate actions in windows

Status
Not open for further replies.

karthikcoep

Beta member
Messages
2
I have a folder with 100 pdf documents. I need to convert these document to xps. The conventional way would be to open each document and print the file using xps printer and save the same in some folder. For this I have to repeat this 100 times. Is there a way to automate this process so that this can be done in one go.
 
set xps as default printer. save the following code to a file named printall.vbs. change the location of the targetfolder. double click vbs icon

Code:
TargetFolder = "\\xxx.xxx.xxx.xxx\c$\Inetpub\wwwroot\WebAdmin\Rewards\printdocs\" 
Set objShell = CreateObject("Shell.Application") 
Set objFolder = objShell.Namespace(TargetFolder) 
Set colItems = objFolder.Items 
For Each objItem In colItems 
objItem.InvokeVerbEx ("Print") 
Next

VBScript to Print all Files from a Folder



edit - eek, you gonna run into issues where each print prompts where to save the file
 
Status
Not open for further replies.
Back
Top Bottom