Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows XP

Understanding Application Compatibility : Scripting Compatibility Layers, Using Compatibility Administrator

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
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
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server