How to Run a Program in Compatibility Mode

因爲應用程序跑在兼容模式下的時候,通過讀取註冊表RegQueryValueEx和GetVersionEx得到的系統名稱和版本號是兼容模式下的操作系統名稱和版本號,所以不得不加以區分和設定,一下是三種設置兼容模式和非兼容模式的方法:
OPTION ONE

To Set Compatibility Mode of Application in Properties Page
1. Right click on the program's shortcut (LNK file), .EXE file, BAT file, CMD file, or MSI file.

2. Click on Properties.

3. Click on the Compatibility tab. (see screenshot below)
NOTE: If the Compatiblity options are grayed out, then it is a 64 bit program and cannot be changed.
Compatibility Mode-compatibility-1.jpg 
4. To Run a Program in Compatibility Mode in Only your User Account 
NOTE:
 Runs the program using settings from a previous version of Windows. Try this setting if you know the program is designed for (or worked in) a specific previous version of Windows.
A) Check the Run this program in compatibility mode for box. (see screenshot below)

B) Click on the drop down menu arrow and select which version of Windows the program was made for. (see screenshot below)
NOTE: Always pick the latest Windows version the program was written for to have a better chance of itrunning properly in Windows 7.
warning   Warning
MSI files (right screenshot below) will only have the Previous version of Windows option available for it. This option will allow Windows 7 to automatically use the previous version compatibility mode it thinks is best for the MSI file to run properly as. You will not be able to do steps 5 and 6 below.
Compatibility Mode-compatibility.jpgCompatibility Mode-msi_properties.jpg 
5. To Change the Settings for a Program in Only your User Account
A) Check or uncheck the settings you want for the program. (see screenshot below)
NOTE: See the table below the screenshot for a description of each setting.
Compatibility Mode-settings.jpg
Setting Description
Run in 256 colors Uses a limited set of colors in the program. Some older programs are designed to use fewer colors.
Run in 640 × 480 screen resolution Runs the program in a smaller-sized window. Try this setting if the graphical user interface appears jagged or is rendered improperly.
Disable visual themes Disables themes on the program. Try this setting if you notice problems with the menus or buttons on the title bar of the program.
Disable desktop composition Turns off transparency and other advanced display features. Choose this setting if window movement appears erratic or you notice other display problems.
Disable display scaling on high DPI settings Turns off automatic resizing of programs if large-scale font size (DPI) is in use. Try this setting if large-scale fonts are interfering with the appearance of the program.
6. To Change the Privilege Level of a Program in Only your User Account
NOTE:
 Runs the program as an administrator. Some programs require administrator privileges to run properly. If you are not currently logged on as an administrator, this option is not available.
A) Check or uncheck the Run this program as an administrator box to enable or disable this option. (see screenshot below)
Compatibility Mode-privilege-level.jpg
7. To Change These Settings for All Users
NOTE:
 You must be logged in as an administrator to be able to do this step.
A) Click on the Change settings for all users button. (See screenshot below)
Compatibility Mode-all_users.jpg
B) Repeat steps 4, 5, and 6 in this new window to apply them to all users on the computer, and click on OK. (see screenshot below)
NOTE: Changes made here will override and gray out the same setting in the window used in step 4, 5, or 6 above.
Compatibility Mode-compatibility_all_users.jpg
8. Click on OK to apply the changes. (see screenshot below step 3)



OPTION TWO

Set Compatibility Mode of Application using "Troubleshoot compatibility"

NOTE: This option opens the Program Compatibility wizard to let Windows 7 help decide what is best to try and make the program compatible.
1. Right click on the program's shortcut (LNK file), .EXE file, BAT file, CMD file, or MSI file, and click on Troubleshoot compatibility. (see screenshot below)
NOTE: You will not have the Troubleshoot compatibility option available for pinned items in the Start Menu or on thetaskbarYou will only have the Troubleshoot compatibility option available for 3rd party programs in the Start Menu - All Programs area instead.
Compatibility Mode-context_menu.jpg
2. You will see this for a moment while Windows 7 is detecting what the issues may be with the program. (see screenshot below)
Compatibility Mode-stepa.jpg
3. The wizard will now give you a list of choices to choose from. Select the option you would like to try, then follow the rest of the onscreen instructions until you are through troubleshooting the compatibility issue with the program. (see screenshot below)
Compatibility Mode-stepb.jpg



OPTION THREE

To Set Compatibility Mode of Application in Registry Editor
1. Open the Start Menu, then type regedit in the search box and press Enter.

2. If prompted by UAC, then click on Yes.

3. In regedit, navigate to each location below one at a time and do the steps below for each location. (see screenshot below) 
Code:
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
Code:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
Compatibility Mode-reg1.jpg 
4. To Run a Program in Compatibility Mode
A) In the right pane of Layers, right click on a empty area and click on New, then on String Value. (see screenshot below)
Compatibility Mode-reg2.jpg 
B) Type in the full path of the program's exe file and press Enter, then right click on the full path and click onModify. (see screenshot below)
Compatibility Mode-reg3.jpg 
C) Type in a single or combination of Data values (see tables below) for how you want to run the program as, and click on OK. (see screenshot below)
NOTE: If you use more than one Settings, then you must add them in the order they are in the table below.

[Compatibility Mode (only one)] + space + [Settings (one or more with a space inbetween)] + space +[Privilege Level]
Compatibility Mode-reg4.jpg
Tip   Tip

EXAMPLE ONE: 
To run a program as if it was in Windows Vista SP2 (Compatibility Mode), and Run in 256 colors (Settings), and to run as administrator you would type:

VISTASP2 256Color RUNASADMIN

EXAMPLE TWO:

Say you also wanted to Run in 640 x 480 screen resolution (2nd Settings) with the above example, you would type:

VISTASP2 256Color 640x480 RUNASADMIN



Compatibility Mode Data Value
Windows 95 WIN95
Windows 98 / Windows Me WIN98
Windows NT 4.0 (Service Pack 5) NT4SP5
Windows 2000 WIN2000
Windows XP (Service Pack 2) WINXPSP2
Windows XP (Service Pack 3) WINXPSP3
Windows Server 2003 (Service Pack 1) WINSRV03SP1
Windows Server 2008 (Service Pack 1) WINSRV08SP1
Windows Vista VISTARTM
Windows Vista (Service Pack 1) VISTASP1
Windows Vista (Service Pack 2) VISTASP2
Windows 7 WIN7RTM

Settings Data Value
Run in 256 colors 256Color
Run in 640 x 480 screen resolution 640x480
Disable visual themes DISABLETHEMES
Disable desktop composition DISABLEDWM
Disable display scaling on high DPI settings HIGHDPIAWARE

Privilege Level Data Value
Run this program as an Administrator RUNASADMIN
5. To Stop a Program from Running in Compatibility Mode
A) In the right pane of Layers, right click on the full path Name and click on Delete. (see screenshot below)
Compatibility Mode-delete1.jpg 
B) Click on Yes to confirm deletion. (see screenshot below)
Compatibility Mode-delete2.jpg
6. Close regedit when done.
NOTE: Some programs may require you to restart the computer for this to be applied.

That's it! FYI







發佈了29 篇原創文章 · 獲贊 20 · 訪問量 34萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章