Help and Support

Article ID: 923357 - Last Review: October 11, 2007 - Revision: 2.6

You cannot use the RUNAS command to print from a 32-bit program in different user accounts in a single session on a computer that is running a 64-bit version of Microsoft Windows

Important This article contains information about how to modify the registry. Make sure that you back up the registry before you modify it. Make sure that you know how to restore the registry if a problem occurs. For more information about how to back up, restore, and modify the registry, click the following article number to view the article in the Microsoft Knowledge Base:
256986  (http://support.microsoft.com/kb/256986/ ) Description of the Microsoft Windows registry

On This Page

Expand all | Collapse all

SYMPTOMS

On a computer that is running a 64-bit version of Microsoft Windows, you cannot use the runas command to print from a 32-bit program in different user accounts in a single session.

CAUSE

This behavior occurs because the system uses the Splwow64.exe process to translate between 32-bit programs and the driver model of the 64-bit operating system. When the Splwow64.exe process is complete, this process remains in memory for a specified time-out period to increase system performance. When you use the runas command to start the 32-bit program, the Splwow64.exe process is available only to the first user until the specified period passes. This period is set by using a registry entry.

WORKAROUND

To work around this behavior, use either of the following methods.

Method 1

Avoid using the runas command to print.

Method 2

Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall the operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.

Follow these steps to change the registry entry that controls the time-out period:
  1. Click Start, click Run, type regedit, and then click OK.
  2. Locate and then right-click the following registry subkey:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print
  3. Point to New, and then click DWORD Value.
  4. Type SplWOW64TimeOut as the registry entry name, and then press ENTER.
  5. Double-click the SplWOW64TimeOut entry that you created in step 4.
  6. Enter a value in the Value Data box, and then click OK.

    The value that you enter in the Value Data box is the number of minutes that the system waits to unload the Splwow64.exe process. This period starts after the last 32-bit process prints and closes. Therefore, when a service process prints, the print capability is not released until the service closes and the time that you specify passes. For example, if you type 1 in the Value data box, and the last 32-bit process takes two minutes to print and close, the print capability is released after three minutes.

STATUS

This behavior is by design.

MORE INFORMATION

On a computer that is running a 64-bit version of Microsoft Windows, only one user account may print from a 32-bit program in a session. In a session, the user account that prints first is the only user account where a 32-bit process can print until a time-out occurs or the session ends. If another user account in the same session tries to print before the session ends, the user account receives an "Invalid Handle" error message. Additionally, the print request is unsuccessful.

More than one process may run in different user accounts in the same session. Examples include the following:
  • Service processes that run in the same session. However, the user accounts that run the service processes are determined by the service settings.
  • Processes that are initiated by using the runas command.
After a print job finishes, the Splwow64.exe process continues to run in the user account where the print job ran. Periodically, the system checks to see whether any processes remain connected to the Splwow64.exe process. During this period, if no processes are connected to the Splwow64.exe process, the Splwow64.exe process shuts down. After the Splwow64.exe process shuts down, another user account can start a new Splwow64.exe process and print. By default, this period takes two minutes. Therefore, after the last process in one user account prints and closes, other user accounts may print after two to four minutes.

Steps to reproduce the behavior

  1. Run a 32-bit program by typing the following command at a command prompt:
    runas /user:user1 your32bitprogram
    Note user1 is the user account in which the 32-bit program will run, and your32bitprogram is the name of the 32-bit program that you want to run.
  2. Enter the password for user1 when you are prompted.
  3. Print a document from the 32-bit program that you ran in step 1.
  4. In the context of a different user, run a 32-bit program at a command prompt by using the following command:
    runas /user:user2 your32bitprogram
    Note user2 is a different user account from the one that you specified in step 1, and your32bitprogram is the name of the 32-bit program that you want to run.
  5. Enter the password for user2 when you are prompted.
  6. Print a document from the 32-bit program that you ran in step 4.

    The behavior that is mentioned in the "Symptoms" section occurs.

APPLIES TO
  • Windows Vista Home Basic 64-bit Edition
  • Windows Vista Home Premium 64-bit Edition
  • Windows Vista Ultimate 64-bit Edition
  • Windows Vista Business 64-bit Edition
  • Windows Vista Enterprise 64-bit Edition
  • Microsoft Windows Server 2003, Standard x64 Edition
  • Microsoft Windows Server 2003, Enterprise x64 Edition
  • Microsoft Windows Server 2003, Datacenter x64 Edition
  • Microsoft Windows Server 2003, Enterprise Edition for Itanium-based Systems
  • Microsoft Windows Server 2003, Datacenter Edition for Itanium-Based Systems
  • Microsoft Windows XP for Itanium-based Systems Version 2003
Keywords: 
kbtshoot kbprb KB923357

Article Translations