About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.
A user closes the one program a remote session was started for, expecting the connection to end. Instead the session stays open, showing only a blank background, for a while. The program is gone, and the user may wonder if the server has hung.
Microsoft's page for this symptom ties it to one thing: the program printed, and printing from a 32-bit program on a 64-bit Remote Desktop Session Host (RD Session Host) starts a helper process that outlives the program. Below are the logic, how to prove it on your own session host, and the one registry value Microsoft documents. Nothing before the Fix section changes anything.
What the error means
Microsoft's symptom text says a Remote Desktop session that specifies a program to start on logon "may not terminate in a timely manner when the specified program is exited". The remote session may appear empty with only a blank background. The program may be specified in either of two places: "Start the following program on connection" in the Remote Desktop Protocol (RDP) client settings, or "Start the following program at logon" in Active Directory user properties. The page's title names RemoteApp sessions as well, and gives no separate symptom for them.
The rule behind it is in the cause section. As part of the session termination logic, if the specified program spawns a new process, that new process is considered part of the program, and the session will not terminate until that process also terminates. The result is a session that stays open for as long as any process the program started is still running.
Likely causes
Microsoft names one scenario that meets this rule: printing from a 32-bit application on a 64-bit RD Session Host. Printing spawns splwow64.exe, which the page describes as the 32-bit to 64-bit thunking process for the spooler. It has a 3-minute timeout, "to prevent the process from being repeatedly respawned during heavy printing", so it does not exit immediately when printing is complete. That can make the remote session appear "hung" with a blank background.
| Condition | What you see | How to check |
|---|---|---|
| A 32-bit program printed during the session | The session stays open with a blank background for a few minutes after the program closes | A process called splwow64.exe is still running in the session after the program has closed |
| The session was started with a specified program | Sessions started with a specified program are the ones the page describes | Check the client's "Start the following program on connection" or the user's "Start the following program at logon" setting |
| Another process the program started is still running | The same blank session, but without splwow64.exe | Look for other processes left running in the session (general advice) |
The third row is not on Microsoft's page, which names only splwow64.exe as its scenario, but the rule it states covers any spawned process, so it is a reasonable second place to look when splwow64.exe is not the one left.
Prove the cause before changing anything
All of these read only.
-
Confirm the session is started with a specified program. Look at the RDP client settings for "Start the following program on connection", or the Active Directory user's property "Start the following program at logon". If neither is set and the user has a normal desktop, the session-termination rule does not explain it.
-
Reproduce with printing, then without. Have a test user run the program, print, close the program, and time how long the session stays open. Microsoft's figure for splwow64.exe is a 3-minute timeout, so a delay of up to about three minutes after the last print fits. Then repeat without printing. If the session ends promptly without printing and lingers after printing, the cause is established. This test is our own suggestion; the page describes the mechanism but gives no test.
-
Look in the stuck session. While the session shows only a blank background, ask an administrator to look at the processes in that session on the host, for example in Task Manager. If splwow64.exe is there, it is the process the session is waiting for. The page does not give a command for this, so it is general advice.
-
Check that the program is 32-bit and the host is 64-bit. The page's scenario needs both. The application's vendor, or the file's location on the server, tells you; the page does not say how to find out.
-
Look at the registry key Microsoft names, HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Sysprocs, and note whether a value called splwow64.exe already exists there. If it does, the fix may already be in place for this host and the cause is elsewhere.
Example (illustrative): at contoso.com.au the accounts program is published on the RD Session Host rds04 as the one program started at logon, and it is a 32-bit program. Staff print an invoice, close the program, and their window stays blank for about three minutes before the connection closes. A colleague who closes the program without printing is logged off at once. This pattern matches the page.
Fix
Microsoft's resolution is to add the splwow64.exe process to a registry key "to tell the operating system that the process may be safely terminated automatically". The key is:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Sysprocs
The page gives the value as: value name splwow64.exe, data type REG_DWORD, base Hex, value data 0. It does not give a command; it describes the value. It does not say whether a restart or a fresh logon is needed for it to take effect.
Add the splwow64.exe value to Sysprocs
Risk: the registry change below applies to every session on that server, not just the one with the problem. A mistake in a registry edit can cause faults that are hard to trace. The page says the process may be safely terminated automatically but does not describe what happens to a print job that is still being spooled in that session at the moment it ends, so do the change on a test server first and print a real document to check.
Before you change the registry, save the key as it is now. The page gives no command for this, so the command here is general advice. In an elevated command prompt, with a file name of your choice that does not already exist:
reg export "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\Sysprocs" "%USERPROFILE%\Documents\sysprocs-before.reg"
Note also whether the splwow64.exe value existed before you started.
Using Registry Editor, go to the Sysprocs key above. Add a new DWORD value named splwow64.exe, with the value data 0 (the page gives the base as Hex, and 0 is the same in either base).
To undo it: in Registry Editor, delete the splwow64.exe value you added from the Sysprocs key. That returns the key to what it was, provided the value did not exist before; if it did, set its data back to what you noted (importing the exported file also puts the old data back).
Confirm the fix
- A test user who prints and then closes the program is logged off promptly, rather than seeing a blank session for about three minutes. Time it against the earlier measurement.
- The printed document still arrives in the user's printer queue. Microsoft's page does not discuss this, so test with a real print.
- Users who never print are outside the scenario the page describes, so expect no change for them.
- Behaviour is the same after the host's next restart. The page does not say whether the value needs a restart, so repeat the test after one.
What to watch afterwards
- New 32-bit programs published to start at logon. Each can bring the same delay if it prints.
- Other programs that start child processes and leave them running. The rule on the page applies to any spawned process, and the splwow64.exe value does not cover them.
- Print-related faults on the same host. If spooler crashes are also occurring, they are a separate problem; the guide to spooler crashes on Remote Desktop hosts covers them.
- The registry value after server rebuilds or restores from an older image. It is not part of a standard build unless you add it.
Read next
Related articles you may want next.
- TroubleshootingPrint Spooler Crashes on Remote Desktop Hosts: Driver ChecksPrint Spooler stops on a Remote Desktop host? Gather crash evidence, check spool files and driver isolation modes, and keep Point and Print protections on.Read article
- TroubleshootingRemote Desktop printer redirection isn't working: redirected printers missing from the sessionRDP drives redirect but printers don't, no event IDs? Microsoft's cause: spooler descriptor lacks AU. Also check Easy Print policy, client.Read article
- HostingIdle limits, disconnect and sign-out: what happens to hosted application workDistinguish session lock, disconnect, sign-out and retained profiles, then choose RDS time limits without promising that autosave keeps a program running.Read article
Risks and limits
These steps have not been run or lab-tested.
Microsoft's page, last updated on 2026-02-12, gives no version range for Windows Server and no figure for how many sessions are affected. It calls the three-minute timeout a property of splwow64.exe and does not say it can be changed. It does not say whether a restart or logoff is needed after adding the value, and it does not describe what happens to a print job in flight when the process is ended. It links a longer Microsoft blog post on RemoteApp session termination logic; that post covers when a RemoteApp session is disconnected and logged off by its own rules, not the splwow64.exe case. Check the current page before relying on these steps, and do not add other process names to the Sysprocs key on the strength of this page alone.
Sources
- Remote Desktop or RemoteApp session does not terminate due to spawned splwow64.exe process — Microsoft Learn, page dated 2026-02-12, accessed 2 December 2026
- Terminal Services RemoteApp™ Session Termination Logic — Microsoft Security Community Blog, posted Sep 07, 2018 (first published 2007), accessed 2 December 2026
This article was originally published on .