Skip navigation

JSI Tip 1193. Alter application execution on Terminal Server.

Most applications run fine on Terminal Server.

You can alter the way an application initializes (in execute mode) by editing the registry. There are three separate paths:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\Myapp
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\IniFiles\MyIniFile
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\RegistryEntries\MyRegistryPathName

which combine to alter the applications behavior. Some of the settings are not usefull for all application. A MS-DOS application never uses the RegistryEntries settings.

The setting that you make are bitmapped values in Value name Flags of, a type REG_DWORD entry. Working in Hexadecimal, you add the data values for each setting to achive the custom setting you want to set. To better understand this methodology, consider the following example:

. You have a application named MyApp.exe.
. MyApp.exe uses and .ini file named MyAppINI.ini.
. MyApp installs a registry key at HKEY_CURRENT_USER\Software\VendorName\Myapp.

Given the above facts, the following registry keys/values can be set:


HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\Myapp
Value name "Flags of" (REG_DWORD):

MS-DOS application: 0x00000001 
OS/2 application: 0x00000002 
Windows 16-bit application: 0x00000004 
Windows 32-bit application: 0x00000008 
Return user name instead of computer name: 0x00000010 
Return Terminal Server build number: 0x00000020 
Disable registry mapping for this application: 0x00000100 
Do not substitute user Windows directory: 0x00000400 
Limit the reported memory: 0x00000800

If MyApp.exe is a 16-bit application, that uses the computer name to maintain a unique identity, you might set Flags of to 0x00000014 (0x00000004 + 0x00000010).

If you want to maintain only one global copy of the registry settings, set Disable registry mapping for this application.
If you set Do not substitute user Windows directory, it will use the Terminal Servers %SystemRoot%.


HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\IniFiles\MyAppINI
Value name "Flags of" (REG_DWORD):

Windows 16-bit application: 0x00000004 
Windows 32-bit application: 0x00000008
Synchronize user .ini file to system version: 0x00000040 
Do not substitute user Windows directory: 0x00000080 

By default, the system master .ini overwrites older versions of the users .ini file. Setting the Synchronize user .. bit adds new entries to the system master .ini file and does not alter the users .ini.

The default action when the system master .ini is copied to the users Windows directory is to replace all Windows paths with the users Windows path. Setting the Do not substitute .. bit, retains the Terminal Servers %SystemRoot%.


HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\RegistryEntries\VendorName\MyApp
Value name "Flags of" (REG_DWORD):

Windows 32-bit application: 0x00000008 
Disable registry mapping for application: 0x00000100 

By default, the system master registry data overwrites older user registry data. Setting Disable registry mapping .. adds new entries to the system master registry image and does not alter user registry entries.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish