Logo
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
EPL Standings
 
 
Windows XP

Understanding Application Compatibility : Scripting Compatibility Layers, Using Compatibility Administrator

8/10/2012 4:28:59 PM

Scripting Compatibility Layers

What do you do if you have a batch file that needs to run one or more programs within a temporary compatibility layer? You can handle this by using the following command within the batch file before you start the program:

SET __COMPAT_LAYER=[!]layer1 [layer2 ...]

Here, layer1 and layer2 are codes that represent the compatibility layers. Table 1 lists the 11 codes you can use.

Table 1. Codes to Use When Scripting Compatibility Layers
CodeCompatibility Layer
Win95Windows 95.
Win98Windows 98 / Windows Me.
Win2000Windows 2000.
NTSP5Windows NT 4.0 SP 5.
256Color256 color.
640x480640×480 screen resolution.
DisableThemesDisable visual themes.
InternationalThis layer handles incompatibilities caused by double-byte character sets.
LUALimited User Access—This layer redirects some Registry and file operations to nonrestricted areas for users that don’t have permission to access restricted areas (such as the HKLM key).
LUACleanupLimited User Access Cleanup—This layer removes the Registry settings and files that were redirected using the LUA layer.
ProfilesSetupProfile Setup Support—This layer is used for older programs that install only for the current user; the layer ensures that the program is installed for all users.

If you’ve already applied one or more layers to the program using the techniques from the previous section, you can tell Windows XP not to use one of those layers by preceding its keyword with the ! symbol. Also, to turn off the compatibility layers, run the command without any parameters, like so:

SET __COMPAT_LAYER=

For example, the following commands set the compatibility layers to Windows 95 and 256 colors, run a program, and then remove the layers:

SET __COMPAT_LAYER=Win95 256Color

D:\Legacy\oldapp.exe

SET __COMPAT_LAYER=

Note

The compatibility layers created by SET __COMPAT_LAYER also apply to any processes that are spawned by the affected application. For example, if you set the Windows 95 layer for Setup.exe, the same layer will also apply to any other executable called by Setup.exe

Using Application Compatibility Toolkit

When you execute a program using a compatibility layer, Windows XP creates an environment within which the program can function properly. For example, a program running under the Win95 layer actually believes that Windows 95 is the operating system. Windows XP accomplishes that not only by returning the Windows 95 version number when the program calls the GetVersion or GetVersionEx API functions, but also by “fixing” other incompatibilities between Windows 95 and Windows XP. For example, Windows 95 programs expect components such as Calculator and Solitaire to be in the %SystemRoot% folder, but in Windows XP these are in the %SystemRoot%\System32\ folder. The Win95 layer intercepts such file calls and reroutes them to the appropriate location.

The Win95 layer comprises more than 50 such fixes, which are part of a large database of incompatibilities maintained by Microsoft. As of this writing, far more than 200 incompatibilities have been identified, and others might be found in the future. To get access to all these fixes and so get fine-tuned control over the compatibility issues relating to any legacy program, you need to use Application Compatibility Toolkit (ACT).

To install ACT, you have two choices:

The ACT package comprises a number of programs and tools. Some of these are for programmers only, so the next two sections look at the main end-user tool: Compatibility Administrator.

Using Compatibility Administrator

To create a usable compatibility fix for an application—one that you can use on your own computer or distribute to other computers—you use Compatibility Administrator. Compatibility Administrator stores fixes in databases:

System databaseThis database contains three items: a list of applications for which Microsoft has applied fixes for known problems, a list of the available compatibility fixes, and the defined compatibility modes (that is, the compatibility layers discussed earlier).
Installed databasesThese are databases that have been installed on this computer.
Custom databasesThese are databases that contain fixes that you applied to one or more applications.

There are two ways to start this program:

  • If you’re using the original version of ACT, select Start, All Programs, Application Compatibility Toolkit, Compatibility Administration Tool.

  • If you’re using the latest version of ACT, select Start, All Programs, Microsoft Application Compatibility Toolkit, Tools, Compatibility Administrator.

Here’s how to create a custom fix database (note that I’m using version 4.0 of Compatibility Administrator for these instructions):

1.
A new database is created for you automatically under the Custom Databases branch. Either select this database or create a new one by clicking Custom Database and then selecting File, New.

2.
Right-click the new database, click Rename, and then enter a name for the database.

3.
To create a new application fix, click the Fix button in the toolbar to launch the Create New Application Fix Wizard.

4.
Enter the program’s name, vendor, and location, and then click Next. The Compatibility Modes dialog box appears.

5.
Choose an operating system mode and use the check boxes in the Select Additional Compatibility Modes list to choose additional layers to apply to the program, as shown in Figure 1. Click Next. The Compatibility Fixes dialog box appears.

Figure 1. Use the Compatibility Modes dialog box to specify an operating system mode and additional compatibility layers.


6.
Use the check boxes to apply specific compatibility fixes and then click Next.

7.
Compatibility Administrator also needs to know how to identify the program. Click Auto-Generate to have the wizard set up the matching attributes for you, and then click Finish.

Compatibility Administrator adds your program to the database. To try out the program, click it and click Run. Then select View, View Log to see the log that Compatibility Administrator created. Use the log to determine which fixes were required by the program. Then edit the fix to deactivate any fixes that aren’t required by the program. To change the fixes, right-click the program’s executable filename in the right pane and then click Edit Application Fix.

After you’ve added all the fixes for all your incompatible programs to the database, save the database file. To enable Windows XP to use the resulting .sdb file, you need to install the file by highlighting it and selecting File, Install. To distribute the fix to another computer, copy the .sdb file to the machine, launch Compatibility Administrator, and then click Open to open the .sdb file. You can then install the database.

Other -----------------
- Understanding Application Compatibility : Determining Whether a Program Is Compatible with Windows XP, Understanding Compatibility Mode
- Remote Collaboration with Microsoft NetMeeting : Using the Whiteboard & Sharing Programs
- Remote Collaboration with Microsoft NetMeeting : Exchanging Files in NetMeeting & Using the Chat Feature
- Remote Collaboration with Microsoft NetMeeting : Placing NetMeeting Calls
- Remote Collaboration with Microsoft NetMeeting : Configuring NetMeeting
- Sending and Receiving Faxes (part 3) - Receiving Faxes
- Sending and Receiving Faxes (part 2) - Sending a Fax
- Sending and Receiving Faxes (part 1) - Installing, Configuring the Fax Service
- Using HyperTerminal for Modem-to-Modem Connections : Connecting to a Remote System & Performing File Transfers
- Using HyperTerminal for Modem-to-Modem Connections : Creating a New HyperTerminal Connection
- Getting Your Modem to Dial Voice Calls for You : Setting Phone Dialer’s Options & Quick Connections with Speed Dial
- Configuring Windows Firewall to Allow Incoming Internet Calls & Placing an Internet or Network Call
- Getting Your Modem to Dial Voice Calls for You : Placing a Voice Call
- Migrating Your Applications from XP to Windows 7
- Migrating from XP to Windows 7 : Installing Windows 7
- Migrating Applications from Windows XP to Windows 7
- Migrating from XP to Windows 7 : Windows 7 Upgrade Advisor
- Surfing the Web Securely (part 3) - Blocking Pop-Up Windows
- Surfing the Web Securely (part 2) - Enhancing Online Privacy by Managing Cookies
- Surfing the Web Securely (part 1) - Adding and Removing Zone Sites
 
 
Most view of day
- Installing and Configuring the Basics of Exchange Server 2013 for a Brand-New Environment (part 6)
- Adobe Photoshop CS5 : Adjusting Contrast Using Curves
- Windows Server 2003 on HP ProLiant Servers : Assessment of the Enterprise - The Assessment Team
- Microsoft Dynamic AX 2009 : Working with .NET Business Connector (part 2) - Exception Handling, Accessing Data
- Working with the User State Migration Tool (part 5) - Getting Extra Mileage Out of the USMT
- Communicating with Internet Email : Filtering Incoming Messages - Blocking Senders, Creating a Mail Rule
- Administering an Exchange Server 2013 Environment (part 6) - Introduction to Role Based Access Control
- Microsoft Content Management Server Development : A Placeholder Control to Store All HTML Tags (part 2)
- System Center Configuration Manager 2007 : Network Design - Use of BITS
- Microsoft PowerPoint 2010 : Animating Slide Content (part 5) - Animating Parts of a Chart, Animation Tips
Top 10
- Windows Server 2012 : DHCP,IPv6 and IPAM - Exploring DHCP (part 3) - Creating IPv4 DHCP Scopes
- Windows Server 2012 : DHCP,IPv6 and IPAM - Exploring DHCP (part 2) - Installing DHCP Server and Server Tools
- Windows Server 2012 : DHCP,IPv6 and IPAM - Exploring DHCP (part 1)
- Windows Server 2012 : DHCP,IPv6 and IPAM - Understanding the Components of an Enterprise Network
- Microsoft OneNote 2010 : Using the Research and Translate Tools (part 3) - Translating Text with the Mini Translator
- Microsoft OneNote 2010 : Using the Research and Translate Tools (part 2) - Translating a Word or Phrase with the Research Pane
- Microsoft OneNote 2010 : Using the Research and Translate Tools (part 1) - Setting Options for the Research Task Pane, Searching with the Research Task Pane
- Microsoft OneNote 2010 : Doing Research with Linked Notes (part 2) - Ending a Linked Notes Session, Viewing Linked Notes
- Microsoft OneNote 2010 : Doing Research with Linked Notes (part 1) - Beginning a Linked Notes Session
- Microsoft OneNote 2010 : Doing Research with Side Notes (part 3) - Moving Side Notes to Your Existing Notes
 
 
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
2015 Camaro