I share my screen with colleagues a lot. During sharing, it's advisable to turn off Aero as it generates much more graphics to send over the wire and causes delays in screen sharing. Some screen sharing applications actually do this for you, and some don't.

I'm looking for a quick and convenient way to switch on/off Aero on Windows 7. Ultimately, if I could tie it to a hotkey, that would be best, but any widget/tray-icon or desktop shortcut would do.

  • What software are you using that doesn't do this FOR YOU when you turn on screen sharing? :/ I can't think of any mainstream ones that don't support it by now.
    – Shinrai
    Nov 11, 2010 at 15:28

3 Answers 3


Create a batch file with the following content:

@echo off
sc interrogate uxsms | find "1062"
if %errorlevel%==0 goto :sc_start
sc stop uxsms

sc start uxsms

Executing it will alternatively turn Aero on and off. You can place it anywhere you like. AFAIK it does not need to be executed as Admin.

  • 1
    This seems to require admin mode on windows 7. Regardless, this is excellent.
    – Frank V
    Feb 25, 2013 at 1:00

You can try:

c:\> sc stop uxsms

c:\> sc start uxsms

Stop, this service is too much. I strongly recommend that we use the native API Windows.

An example of code in PowerShell:

# Definition des fonctions natives Windows permettant le test d'activation d'Aero et l'activation ou non d'Aero
$def = @"

    [DllImport("dwmapi.dll", PreserveSig = false)]
    public static extern bool DwmIsCompositionEnabled();

    [DllImport("dwmapi.dll", PreserveSig=false)]
    public static extern int DwmEnableComposition(bool fEnable);

# Chargement de la fonction native dans un namespace personnel
Add-Type -Namespace MaifCode -Name Aero -MemberDefinition $def

# Fonction qui check si Aero est desactive ou non
function Check-Is-Aero{
    Write-Verbose "[$([DateTime]::Now)] ==> Test de la presence du mode Aero pour la session utilisateur $env:USERNAME"
        Write-Verbose "[$([DateTime]::Now)] ==> Aero actif pour la session utilisateur $env:USERNAME"
        return $true
        Write-Verbose "[$([DateTime]::Now)] ==> Aero inactif pour la session utilisateur $env:USERNAME"
        return $false

# Fonction qui test si Aero est actif et le desactive dans ce cas
function Disable-Aero{
    # Test si aero actif
    If(Check-Is-Aero) {
        Write-Verbose "[$([DateTime]::Now)] ==> Tentative de desactivation du mode Aero pour la session utilisateur $env:USERNAME"
        # Desactivation du mode aero
            $resultat = [MaifCode.Aero]::DwmEnableComposition($false)
        catch [exception]
            # Si erreur alors on sort et on affiche le message d'erreur
            Write-Error "Erreur dans l'execution de la desactivation du mode Aero : $error"
            exit -1
        Write-Verbose "[$([DateTime]::Now)] ==> Desactivation du mode Aero pour la session utilisateur $env:USERNAME terminee"
        Write-Verbose "[$([DateTime]::Now)] ==> sortie du script sans action"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.