SetDefaultPrinter sets a wrong default printer in Windows

Symptoms

Assume that you have a computer that is running Windows 8.1, Windows RT 8.1, Windows Server 2012 R2, Windows 7 Service Pack 1 (SP1), or Windows Server 2008 R2 SP1. When a service on the computer impersonates a user and then calls SetDefaultPrinter to set a default printer, you find the default printer is set to a wrong printer rather than to the expected one.

Cause

This issue occurs because when the impersonated user calls SetDefaultPrinter to set a default printer, some registry values may be set in the wrong user profile. These values will be set in the service account's profile rather than in the impersonated user's profile.

Resolution

To resolve this issue in Windows RT 8.1, Windows 8.1, or Windows Server 2012 R2, install update rollup 2955164.

To resolve this issue in Windows 7 SP1 or Windows Server 2008 R2 SP1, install the hotfix that is described in this article.

Update information for Windows RT 8.1, Windows 8.1, and Windows Server 2012 R2

For more information about how to obtain this update rollup package, click the following article number to view the article in the Microsoft Knowledge Base:
2955164 Windows RT 8.1, Windows 8.1, and Windows Server 2012 R2 update rollup: May 2014

Hotfix information

A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem.

If the hotfix is available for download, there is a "Hotfix Download Available" section at the top of this Knowledge Base article. If this section does not appear, submit a request to Microsoft Customer Service and Support to obtain the hotfix.

Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft website: Note The "Hotfix Download Available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.

Prerequisites

To apply this hotfix, you must be running Windows 7 SP1 or Windows Server 2008 R2 SP1. For more information about how to obtain a Windows 7 or Windows Server 2008 R2 service pack, click the following article number to view the article in the Microsoft Knowledge Base:
976932 Information about Service Pack 1 for Windows 7 and for Windows Server 2008 R2

Registry information

To use the update in this package, you do not have to make any changes to the registry.

Restart requirement

You do not have to restart the computer after you apply this update.

Update replacement information

This update does not replace a previously released update.
File information

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

More Information

For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:
824684 Description of the standard terminology that is used to describe Microsoft software updates

Additional file information

Additional file information for Windows 7 and Windows Server 2008 R2
Properties

Article ID: 2927901 - Last Review: 13 May 2014 - Revision: 1

Feedback