Link to home
Start Free TrialLog in
Avatar of cstallings
cstallingsFlag for United States of America

asked on

Print XPS documents from command line.

I need to know how to print XPS comments from command line. We are trying to create a code that will print xps documents that are in a folder. We are unable to find a way to send xps print documents from command line. ANy help would be great. Thanks.
Avatar of Giovanni
Giovanni
Flag of United States of America image

One method... requires converting to PDF. See: http://verydoc.com/xps-to-pdf.html

@echo off
xps2pdf.exe C:\in\*.xps C:\out\*.pdf
for /f "delims=?" %%f in ('dir C:\out\*.pdf /b') do (
	AcroRd32.exe /t "%%f" "\\servername\printername"
        del %%f
)

Open in new window

If you have XPS Viewer installed... start "example.xps" -p  also works if installed and associated with XPS files.
@echo off
for /f "delims=?" %%f in ('dir *.xps /b') do (
	xpsrchvw "%%f" -p
)

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Giovanni
Giovanni
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial