Changing the Default Format for Microsoft XPS Document Writer
Switching between OpenXPS (.oxps) and Microsoft XPS (.xps)
The Windows 8 operating system introduces support for the international standard OpenXPS format in addition to the Microsoft XPS format. Windows provides a convenient way to create XPS documents by printing from any application to the Microsoft XPS Document Writer (MXDW). In the Windows 8 Consumer Preview, MXDW defaults to the new OpenXPS format. For users who frequently share Microsoft XPS documents with users that cannot read OpenXPS format, Windows 8 provides two methods for changing the default format of MXDW to the Microsoft XPS format.
In this article:
Changing File Type When Printing from Desktop Applications
When printing from a desktop application, users can select XPS directly from the "Save as type" combo box. This does not change the system's default format.
To use this method, follow these steps:
- Print from your desktop application to MXDW.
- When the Save Print Output As dialog box appears, select the "Save as type" combo box to expand.
- Select "XPS Document (*.xps)."
- Click "Save" to output the file as Microsoft XPS.
This method can also be used to quickly convert XPS files from one type to another using these steps:
- Open the XPS file (OpenXPS or Microsoft XPS) in the desktop XPS Viewer application.
- Print the document to MXDW.
- Select the opposite format in the "Save as type" combo box.
- Click "Save" and output the file to the new format.
Metro style applications in Windows 8 automatically output to the default format defined by the printer in print-to-file scenarios. With the above desktop XPS Viewer method, users of Metro style applications can easily convert OpenXPS files to Microsoft XPS.
Changing the Default MXDW Format
There are two methods to change the default format of MXDW between OpenXPS and Microsoft XPS:
- Set the default in Group Policy. (32-bit and 64-bit client only)
- Use Windows PowerShell to toggle the default format. (32-bit and 64-bit client AND Windows 8 RT)
Changing the default Microsoft XPS will have the following results:
- Metro style applications will output Microsoft XPS (*.xps) by default.
- Desktop applications will default to Microsoft XPS (*.xps); however, the user can choose OpenXPS (*.oxps) from the "Save as type" combo box.
Returning the default to OpenXPS will restore the system to the original behavior.
Using Group Policy
To use Group Policy to change the default format, take the following steps:
- Search for "Group Policy" and select "Edit Group Policy" from Settings.
- In the Group Policy control panel, select Local Computer Policy\Computer Configuration\Administrative Templates\Printers in the tree on the left of the screen. Then, double-click "Change Microsoft XPS Document Writer (MXDW) default output format to the legacy Microsoft XPS format (*.xps)" to open the options.
- You can make the following selections:
- "NotConfigured" and "Disabled" will set the MXDW default to OpenXPS.
- "Enabled" will set the MXDW default to Microsoft XPS.
- Click OK to save settings.
Note: You may need to logoff/login or force a Group Policy update from an administrator command prompt (gpupdate /force) before the change in policy will take effect.
Using Windows PowerShell
Windows PowerShell provides a powerful set of commands that allow the user to manage Windows 8. With Windows PowerShell, the user can change the same registry value for the MXDW default that is updated by Group Policy in the above procedure.
To use Windows PowerShell to change the default, follow these steps:
- Search for "PowerShell" and select "Windows PowerShell" from Apps.
- Launch Windows PowerShell as an administrator. This can be done by selecting Windows PowerShell with a right-click and then choosing "Run as administrator" from the options at the bottom of the screen, or by holding down CTRL+Shift while left-clicking "Windows PowerShell."
By default, the execution policy for Powershell is restricted. Execute the following command to change the policy for the Powershell process you are working in: Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process
- When prompted to confirm execution policy change, enter "Y".
The following script will check for the appropriate registry path and key and then toggle the format between OpenXPS and Microsoft XPS:
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process -Force
if(!(test-path "hklm:\software\policies\Microsoft\Windows NT\Printers"))
New-Item -Path "hklm:\software\policies\Microsoft\Windows NT\Printers"
New-ItemProperty "hklm:\software\policies\Microsoft\Windows NT\Printers\" -Name "MXDWUseLegacyOutputFormatMSXPS" -Value 0 -PropertyType "DWORD" -ErrorAction SilentlyContinue
$KeyValue = (Get-ItemProperty -Path "hklm:\software\policies\Microsoft\Windows NT\Printers" -Name "MXDWUseLegacyOutputFormatMSXPS")."MXDWUseLegacyOutputFormatMSXPS"
Set-ItemProperty -Path "hklm:\software\policies\Microsoft\Windows NT\Printers" -Name "MXDWUseLegacyOutputFormatMSXPS" -Value 0
Set-ItemProperty -Path "hklm:\software\policies\Microsoft\Windows NT\Printers" -Name "MXDWUseLegacyOutputFormatMSXPS" -Value 1
Note: You can
download the script and run it from Windows PowerShell as shown below substituting the path on your system for the one in the example: