JSI Tip 1193. Alter application execution on Terminal Server.

Learn how to alter application execution on Terminal Server.

Jerold Schulman

March 30, 1999

2 Min Read
ITPro Today logo in a gray background | ITPro Today

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_MACHINESoftwareMicrosoftWindows NTCurrentVersionTerminal ServerCompatibilityApplicationsMyappHKEY_LOCAL_MACHINESoftwareMicrosoftWindows NTCurrentVersionTerminal ServerCompatibilityIniFilesMyIniFileHKEY_LOCAL_MACHINESoftwareMicrosoftWindows NTCurrentVersionTerminal ServerCompatibilityRegistryEntriesMyRegistryPathName

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_USERSoftwareVendorNameMyapp.

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

HKEY_LOCAL_MACHINESoftwareMicrosoftWindows NTCurrentVersionTerminal ServerCompatibilityApplicationsMyappValue 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_MACHINESoftwareMicrosoftWindows NTCurrentVersionTerminal ServerCompatibilityIniFilesMyAppINIValue name "Flags of" (REG_DWORD):Windows 16-bit application: 0x00000004 Windows 32-bit application: 0x00000008Synchronize 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_MACHINESoftwareMicrosoftWindows NTCurrentVersionTerminal ServerCompatibilityRegistryEntriesVendorNameMyAppValue 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.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like