Windows – Cannot enable Microsoft Print to PDF once it is disabled

command linepowershellprint to pdfwindows 10

I used the following command to find the feature name and the second one (Powershell) to disable Microsoft Print to PDF, and the third one to re-enable it.

DISM /online /get-features /format:table | find "Disabled"

Disable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Windows-Printing-PrintToPDFServices-Package"

Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Windows-Printing-PrintToPDFServices-Package"

The disable command works perfectly, however, I get the following message when trying to enable it.

"enable-windowsoptionalfeature : One of several parent features are disabled so current feature can not be enabled." (See Screenshot)

enable-windowsoptionalfeature error

Secondly, I try to enable the feature through "Turn Windows features On or Off" but it can't be found. (See screenshot)

Turn Windows Features On or Off

I have researched this for several hours now and the only information I can find is how to add the printer back through Programs and Features. I would appreciate all help resolving this problem.

Best Answer

A Bug has been reported in Windows 10, dating to version 1607, whereby Disable-WindowsOptionalFeature deletes the feature files even though it is supposed to happen only when specifying the /Remove switch. This make it impossible to re-enable the feature by using Enable-WindowsOptionalFeature, since it's simply gone from Windows.

You could try to use the -All parameter that may also install any required parent packages:

Enable-WindowsOptionalFeature -online -FeatureName Printing-PrintToPDFServices-Features -All

If this does not fix the problem, then the only solution, until Microsoft fixes this bug (if ever), is to include a source when you install it again, which should be an extracted Windows ISO of exactly the same version you are working with.

This might do it:

Enable-WindowsOptionalFeature -online -FeatureName Printing-PrintToPDFServices-Features -All -Source "C:\SourceISO\sxs"

(Note: I have not tested these commands.)

Related Question