DosProbie Posted February 26, 2013 Share Posted February 26, 2013 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 defaultto 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,11pushd %~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 > ==========>:mainmenuclsecho.echo. echo [ MAIN MENU ]echo +=====================+ echo A.) ENABLE Metro Appsecho.echo B.) DISABLE Metro Appsecho.echo C.) [EXIT] And Rebootecho +=====================+ echo. :selectset /p userinp= ^ Make your selection: set userinp=%userinp:~0,1%if /i "%userinp%"=="A" goto enableif /i "%userinp%"=="B" goto disableif /i "%userinp%"=="C" goto exitecho.Invalid! Try Again...echo.goto select:enableclsecho Press any [KEY] To Enable Metro...&pause>nul&goto :on:oncls:: • 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>nulreg 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>nulreg add "hklm\software\microsoft\windows\currentversion\policies\system" /v ConsentPromptBehaviorUser /t reg_dword /d 0 /f>nulreg add "hklm\software\microsoft\windows\currentversion\policies\system" /v PromptOnSecureDesktop /t reg_dword /d 0 /f>nulecho.clsecho * ENABLED * == Press Any [KEY] To Return To The Main Menu ==&pause>nul&goto :mainmenu::===========+:disableclsecho Press any [KEY] To Disable Metro...&pause>nul&goto :off:offcls:: • 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>nulreg add "hklm\software\microsoft\windows\currentversion\policies\system" /v FilterAdministratorToken /t reg_dword /d 0 /f>nulreg add "hklm\software\microsoft\windows\currentversion\policies\system" /v ConsentPromptBehaviorAdmin /t reg_dword /d 0 /f>nulreg add "hklm\software\microsoft\windows\currentversion\policies\system" /v ConsentPromptBehaviorUser /t reg_dword /d 0 /f>nulreg add "hklm\software\microsoft\windows\currentversion\policies\system" /v PromptOnSecureDesktop /t reg_dword /d 0 /f>nulecho.clsecho * DISABLED * == Press Any [KEY] To Return To The Main Menu ==&pause>nul&goto :mainmenu::===========+:: • EXIT AND REBOOT • :exitclsset /p option=* EXIT * Press [ENTER] To Reboot For Changes..&shutdown.exe -f -r -t 0&cls&exit Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now