Setting windows compatibility mode in VB.NET

Thread Starter

cmartinez

Joined Jan 17, 2007
8,218
I need to set some of my programs written in VB.NET (express, 2012 and 2013) so that they run in win2000 or winXP compatibility mode. The way I do that is by (in the file explorer) right clicking on the compiled executable file, and then setting the appropriate options.

Question, is there a function, or some sort of windows call, that would allow me to do just that within the code, so that after the program is compiled there would no longer be need to set those options externally?
 

vpoko

Joined Jan 5, 2012
267
The thing is, compatibility mode isn't a feature of the exe file but is determined by a registry entries with a path to the exe. Your installer will need to write to the registry, specifically HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers

If you Google that registry key, you should be able to get more info.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,218
The thing is, compatibility mode isn't a feature of the exe file but is determined by a registry entries with a path to the exe. Your installer will need to write to the registry, specifically HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers

If you Google that registry key, you should be able to get more info.
Thanks for your answer. Is there also an internal workaround for setting the process affinity mode?
 
Top