__COMPAT_LAYER variable.

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
npocmaka_
Posts: 512
Joined: 24 Jun 2013 17:10
Location: Bulgaria
Contact:

__COMPAT_LAYER variable.

#1 Post by npocmaka_ » 29 Mar 2016 13:02

I've played a little bit (more) with IExpress and found that it sets __COMPAT_LAYER variable to DetectorsWin8.

Looks like it's used to run applications in compatibility mode and can suppressthe UAC window.

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: __COMPAT_LAYER variable.

#2 Post by aGerman » 29 Mar 2016 14:02

You may use

Code: Select all

set "__COMPAT_LAYER=RunAsInvoker"

to suppress the UAC prompt of Programs that require the UAC. The result is that the process runs as normal logged user (without elevatet rights). The process is not able to execute operations that would require administrative rights.
Typical example:

Code: Select all

@echo off
set "__COMPAT_LAYER=RunAsInvoker"
start "" "regedit.exe"

No UAC prompt will show up but e.g. you can't change anything in HKLM even if you can in HKCU.

Regards
aGerman

npocmaka_
Posts: 512
Joined: 24 Jun 2013 17:10
Location: Bulgaria
Contact:

Re: __COMPAT_LAYER variable.

#3 Post by npocmaka_ » 29 Mar 2016 14:16

You can set more than one values at the same time separated with space
Besides compatibility modes described in the link here are some OS compatibilities :

VistaRTM
DetectorsWin8 // i have no idea what this is used for
VistaSP1
VistaSP2
Win7RTM
Win8RTM
WINXPSP3
Win95
Installer // Also I'm not completely sure what's this

miskox
Posts: 553
Joined: 28 Jun 2010 03:46

Re: __COMPAT_LAYER variable.

#4 Post by miskox » 30 Mar 2016 23:43

[quote="aGerman"]You may use

Code: Select all

set "__COMPAT_LAYER=RunAsInvoker"

to suppress the UAC prompt of Programs that require the UAC. The result is that the process runs as normal logged user (without elevatet rights). The process is not able to execute operations that would require administrative rights.

Great! Works like a charm!

Thanks.
Saso

Post Reply