Remote Desktop session will not completely log off because xyz application is running

remote desktopwindows-server-2008windows-server-2016

We use the Remote Desktop role in Server 2008 Enterprise SP2 to give users access to a 32-bit application. It is configured to auto-start the application via the "Start the following program at logon:" property for the user. When the user exits from the application, it should automatically log them off the server.

However, it simply hangs with a blank desktop in the RDP session. If we run task manager in the session, we can see that splwow64.exe is still running (along with the other standard RDP session applications.) If we terminate splwow64.exe then the session logs off.

How can we force splwow64.exe to terminate with our application so the session will log off?

Best Answer

Using Regedit, add a REG_DWORD called "splwow64.exe" to

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\SysProcs

and set the value to 0.

This tells the operating system that splwow64.exe can be safely terminated. This technique can be used for any application that needs to be terminated when the user logs off.