11

I am using the program "SoftXPand 2011 Duo" by Miniframe on my Windows 7 PC. It makes two workstations out of one computer. It uses the terminal services built into Windows to create the additional session. I use two screens, two keyboards and two mice to create this "illusion" of two computers. It works quite well and I can even play two different 3D games on the two screens attached to this single machine (using a Radeon HD5770 and a Core i5 2500k with 8 Gbytes RAM).

There are a few downsides to this. I just found about one that is hidden on the first look. The sessions you are in (even on the first workstation) will identify as a terminal server session! Now some programs will run with limited effects (graphical), and some won't run at all.

This also resulted in some games not running at all. They just say "Cannot be run in a terminal server session" and exit. I have already proven that top modern games (DirectX 10, 11) run just as good as on the same machine without SoftXPand, so this is a pretty artificial limitation!

So, can I somehow hack my current session so it doesn't look like a terminal server session anymore? I. E.

#include <windows.h>
#pragma comment(lib, "user32.lib")

BOOL IsRemoteSession(void)
{
   return GetSystemMetrics( SM_REMOTESESSION );
}

Will return FALSE? (Not a programming question! Just an example how programs detect if they're in a terminal server session!)

3
  • Do you have two keyboards/screens ? Please elaborate some more on your setup.
    – harrymc
    Jun 27, 2011 at 7:57
  • @harrymc Yes, I do. Editing.
    – sinni800
    Jun 27, 2011 at 15:18
  • The reason apps refuse to run on a terminal server, even when you are using the console session, is because of licensing reasons - so that one licence cannot be used by more than one person at the same time.
    – paradroid
    Jul 12, 2011 at 12:38

4 Answers 4

9

There are several ways for an application to check whether it is running in a Terminal Server session. Some of them you might hack, as below :

  1. Registry : HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\TSAppCompat.
    This key is missing in a normal session on my desktop.
    You might try to delete it, if you can.
  2. SESSIONNAME environment variable values : Console / "RDP#" / (empty).
    You may try to run your game from the Command Prompt (cmd) after doing
    SET SESSIONNAME=Console (my desktop value) or SET SESSIONNAME= (empty).
    To find out its current value, enter SET SESSIONNAME before changing anything.
  3. The system calls GetSystemMetrics(SM_REMOTESESSION) and GetVersionEx (OSVERSIONINFOEX.wSuiteMask) return the execution context.
    Not much you can do against this one, except writing a system-hook for it.
    If interested see this codeproject.com article : API hooking revealed.
6
  • On 2), the session name is "console" (What the heck?). The key TSAppCompat is missing here, too. About the third... Looks hard to do. Isn't there a program that sits on top of another program and intercepts system calls like the one I mentioned? GetSystemMetrics.
    – sinni800
    Jun 27, 2011 at 19:58
  • According to your info, probably the 3rd method is the one worth attacking for GetVersionEx and GetSystemMetrics. I have added a link above (to be used by a programmer).
    – harrymc
    Jun 29, 2011 at 7:37
  • Another note : If there a way to use MSTSC /admin in SoftXPand, this is worth a try.
    – harrymc
    Jun 29, 2011 at 7:49
  • @harrymc why MSTSC /admin? I will look into the api hooking... It might be too complex for my programming abilities though.
    – sinni800
    Jun 29, 2011 at 13:16
  • "MSTSC /admin" is a rather long shot : it is a somewhat different remote session type, so maybe some programs may not detect it.
    – harrymc
    Jun 29, 2011 at 13:44
0

I found a solution: running the programs you want by "runas"

After you log in via desktop, type that in cmd:

runas /user:YOUR_NAME "YOUR_PROGRAM_PATH"

I tested it against Bently's softwares and they do work well.

2
  • This circumvents the terminal server issue? Interesting, I have to try.
    – sinni800
    Jun 17, 2014 at 9:00
  • Does not work with mass effect 3 (This program cannot be run remotely)
    – Mgamerz
    Sep 5, 2016 at 16:31
0

I'm using Microsoft Remote Desktop and I've tried the first 2 methods posted by @harrymc, but they don't work in my case. The third is too complicated for me so I've not given it a try.

In the end, I found that Parallel Access enables me to use the program that was showing the error. It's not as smooth as RDP, so I use it if I really have to use the program.

0

Doesn't address the SoftXPand question directly but I ended up here because of a Google search and it is along @harrymc's answer.

I created a batch file that had a delay of 60 seconds and then starts the app I want to run. I started the batch file, logged out of my RDP connection, waited about 5 minutes and then reconnected with RDP. The pesky app I wanted was waiting for me when I got back on. Here's the batch file contents:

timeout 60

start /D "your path here" yourExecutable.exe

The quotes around the path are necessary if you have spaces in the path.

Got the batch info stuff from here: https://stackoverflow.com/questions/8324352/creating-a-batch-file-for-programs-to-start-using-a-delay

props to this guy: https://stackoverflow.com/users/959263/raihan

(it said to provide details and share my research)

1
  • Interesting solution, I don't know if it will be able to apply to SoftXPand though, to be honest. As I can't "leave" the session like with RDP.
    – sinni800
    Feb 27, 2020 at 6:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.