Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account


Photo

** Quickly Toggle Metro Apps On and Off **


  • Please log in to reply
No replies to this topic

#1
DosProbie

DosProbie

    Senior Member

  • Members
  • PipPipPipPip
  • 554 posts
  • OS:Windows 8 x64
  • Country: Country Flag

Donator

If your getting the Metro Admin error message when attempting to launch a Metro app because you are the Built-in Administrator for Windows 8 like I am then you probably already know that the Metro Apps are disabled by default
to circumvent this I created a menu driven batch file that will enable metro when I want to use the apps then disable when I am not using, Of course you can also pin a shortcut to the desktop or taskbar with a Win8 icon for quicker access...Enjoy! DosProbie


echo off&color a && cls && Mode 62,11
pushd %~dp0%
title,  [ TOGGLE METRO APPS ON/OFF ]
:: = NOTES =
:: THIS BATCH ONLY WORKS FOR THE BUILT-IN ADMINISTRATOR ACCOUNT!
:: Auto set the Admin Approval Mode via Command Prompt without messing with the Local Security Policy settings..
:: Fixes The Pop-up Nag ==>"This app can't be activated when UAC is disabled and/or by the Built-in Administrator."
:: Sets GPO Settings For Metro Apps (1=Enabled and 0=Disabled and UAC Setting to: 0=Never 5=Notify)
:: DOS_PROBIE. 02.25.13

::  RUNS BATCH WITH "ELEVATED PERMISSIONS" AS THE BUILT-IN ADMINISTRATOR  (Prevents "ERROR: Access is denied.")
REM  --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"

REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
    echo Requesting administrative privileges...
    goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"

    "%temp%\getadmin.vbs"
    exit /B

:gotAdmin

    if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
    pushd "%CD%"
    CD /D "%~dp0"
::<========== < BATCH SCRIPT > ==========>
:mainmenu
cls
echo.
echo.  
echo            [ MAIN MENU ]
echo      +=====================+  
echo       A.) ENABLE Metro Apps
echo.
echo       B.) DISABLE Metro Apps
echo.
echo       C.) [EXIT] And Reboot
echo      +=====================+ 
echo.  
:select
set /p userinp=    ^   Make your selection: 
set userinp=%userinp:~0,1%
if /i "%userinp%"=="A" goto enable
if /i "%userinp%"=="B" goto disable
if /i "%userinp%"=="C" goto exit
echo.Invalid! Try Again...
echo.
goto select
:enable
cls
echo Press any [KEY] To Enable Metro...&pause>nul&goto :on
:on
cls
::  ENABLE METRO FOR ADMIN(Runs as "Current User" with UAC Disabled) 
reg add "hklm\software\microsoft\windows\currentversion\policies\system" /v EnableLUA /t reg_dword /d 1 /f>nul
reg add "hklm\software\microsoft\windows\currentversion\policies\system" /v FilterAdministratorToken /t reg_dword /d 1 /f>nul
 reg add "hklm\software\microsoft\windows\currentversion\policies\system" /v ConsentPromptBehaviorAdmin /t reg_dword /d 0 /f>nul
reg add "hklm\software\microsoft\windows\currentversion\policies\system" /v ConsentPromptBehaviorUser /t reg_dword /d 0 /f>nul
reg add "hklm\software\microsoft\windows\currentversion\policies\system" /v PromptOnSecureDesktop /t reg_dword /d 0 /f>nul

echo.
cls
echo * ENABLED * == Press Any [KEY] To Return To The Main Menu ==&pause>nul&goto :mainmenu
::===========+
:disable
cls
echo Press any [KEY] To Disable Metro...&pause>nul&goto :off
:off
cls
::  DISABLE METRO APPS(Return as "Built-In Admin" with UAC Disabled) 
reg add "hklm\software\microsoft\windows\currentversion\policies\system" /v EnableLUA /t reg_dword /d 1 /f>nul
reg add "hklm\software\microsoft\windows\currentversion\policies\system" /v FilterAdministratorToken /t reg_dword /d 0 /f>nul
reg add "hklm\software\microsoft\windows\currentversion\policies\system" /v ConsentPromptBehaviorAdmin /t reg_dword /d 0 /f>nul
reg add "hklm\software\microsoft\windows\currentversion\policies\system" /v ConsentPromptBehaviorUser /t reg_dword /d 0 /f>nul
reg add "hklm\software\microsoft\windows\currentversion\policies\system" /v PromptOnSecureDesktop /t reg_dword /d 0 /f>nul
echo.
cls
echo * DISABLED * == Press Any [KEY] To Return To The Main Menu ==&pause>nul&goto :mainmenu
::===========+
::  EXIT AND REBOOT  
:exit
cls
set /p option=* EXIT *  Press [ENTER] To Reboot For Changes..&shutdown.exe -f -r -t 0&cls&exit




How to remove advertisement from MSFN



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users



How to remove advertisement from MSFN