Article ID: 286705 - Last Review: January 25, 2006 - Revision: 1.3 HOW TO: Script Compatibility Layers in Windows XPThis article was previously published under Q286705 On This PageSUMMARY
Windows XP includes technology to dynamically apply compatibility fixes for programs that are not designed to run on Windows XP. The compatibility fixes are provided to assist an earlier version of a program in avoiding any issues that may arise because of the changes in this new operating system. These compatibility fixes may be used individually or in ready-to-use groups called compatibility layers. These layers have been defined for several commonly encountered configurations. An example is a layer that provides the compatibility fixes necessary for a program that was written specifically for Microsoft Windows 95. This article describes how you can script compatibility layers in Windows XP. Applying Compatibility LayersMicrosoft has created a series of tools to make the use of the compatibility technologies accessible both through graphical user interface (GUI) tools and from the command prompt. Normally, the GUI tools are the preferred method of applying compatibility fixes or layers, but occasionally you may encounter cases where the layers must be applied through a script or batch file. This article explains how to apply a compatibility fix through a script or batch file.The following command syntax should be used when you apply compatibility layers in batch files or scripts: Layer_name: The short name of the compatibility layer being applied. [!]Layers should not be added to existing compatibility fixes in the database files. NOTE: Compatibility layer names must be separated by a space. For example: For example: The list of available compatibility layers includes the following short name and its full name:
TroubleshootingAs an example of how you might implement this command, consider the following scenario: You have a batch file that performs several vital configuration tasks before starting a program. The program requires a series of compatibility fixes that are included in the Windows 95 compatibility layer. If the compatibility layer needs to be applied only to the Setup.exe program, and not to any processes that Setup.exe may spawn, the GUI tools are preferable. You then right-click the .bat or .cmd file and apply the compatibility layer to the batch file.The following sample illustrates a portion of a batch file that might be used in this type of scenario:
Md C:\Program Files\MyCompany\MyApp
If the Setup.exe program requires the compatibility fixes provided by the Windows 95 compatibility layer, and they must be passed on recursively to any process spawned by Setup.exe, the GUI tools are not appropriate. You can resolve this issue by including the following command in the batch file before you call the program that requires the compatibility layer:
Copy D:\i386\*.* C:\Program Files\MyCompany\MyApp C:\Program Files\MyCompany\MyApp\Setup.exe
Md C:\Program Files\MyCompany\MyApp
This effectively applies the Windows 95 compatibility layer to the Setup.exe program and recursively to any process spawned by Setup.exe.Copy D:\i386\*.* C:\Program Files\MyCompany\MyApp set __COMPAT_LAYER=Win95 C:\Program Files\MyCompany\MyApp\Setup.exe This technique can be used in batch files, as shown in the previous example, and it can also be applied successfully in logon scripts. This provides network administrators with a solution to issues raised by any program that requires compatibility layers and that must be called through a batch file where the program may spawn other processes. REFERENCES
| Other Resources Other Support Sites
CommunityGet Help NowArticle Translations
|














Back to the top
