Friday, 3 May 2013

Scripting Compatibility Mode


Due to certain policies we have in place, the compatability wizard is disabled for users. They cant run anything as an admin and cant install software.

With some staff being remote, installing software is a challenge that is normally solved by SCCM deployments. However, doing this for 1 user is overkill in my opinion.


What we would normally do is remote in using SCCM Remote Tools, and run the install as an admin. Great, until the application needs to be run as an old version of Windows. Since you are doing a “run as”, you cant just change the compatability mode using the properties window as this is user specific.

 
There is a environmental variable that can be run, but finding information on it is a little difficult.




__COMPAT_LAYER


 
So the command to use it is:




set __COMPAT_LAYER=


 
Add this at the start of a batch file and everything that comes after is run using the settings used. This didnt work for me when I do "run as another user" on the batch file, but worked fine with "Run as Administrator". Which is fine as I have a tool that allows me to run CMD as Administrator using SCCM.

 Here are some of the options you can use: seperated by a space

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
Run this program as Invoker
RUNASINVOKER

No comments:

Post a Comment