- Local time
- 12:48 PM
- Posts
- 2,268
- OS
- Windows 11 Pro
For anyone interested, here is a batch I made to choose the Windows 10 or Windows 11 Action Center. It will execute your choice and restart explorer to apply the change. nothing fancy... i'll make a powershell gui when i have some free time. copy the below code and paste in notepad. save file as NAME.bat (make sure you remove the .txt extension by choosing "All type (*.*)" from the save as dropdown.
win 10
win 11
Code:
@echo off
:init
setlocal DisableDelayedExpansion
set "batchPath=%~0"
for %%k in (%0) do set batchName=%%~nk
set "vbsGetPrivileges=%temp%\OEgetPriv_%batchName%.vbs"
setlocal EnableDelayedExpansion
:checkPrivileges
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )
:getPrivileges
if '%1'=='ELEV' (echo ELEV & shift /1 & goto gotPrivileges)
ECHO Set UAC = CreateObject^("Shell.Application"^) > "%vbsGetPrivileges%"
ECHO args = "ELEV " >> "%vbsGetPrivileges%"
ECHO For Each strArg in WScript.Arguments >> "%vbsGetPrivileges%"
ECHO args = args ^& strArg ^& " " >> "%vbsGetPrivileges%"
ECHO Next >> "%vbsGetPrivileges%"
ECHO UAC.ShellExecute "!batchPath!", args, "", "runas", 1 >> "%vbsGetPrivileges%"
"%SystemRoot%\System32\WScript.exe" "%vbsGetPrivileges%" %*
exit /B
:gotPrivileges
setlocal & pushd .
cd /d %~dp0
if '%1'=='ELEV' (del "%vbsGetPrivileges%" 1>nul 2>nul & shift /1)
REM Run shell as admin (example) - put here code as you like
ECHO %batchName% Arguments: %1 %2 %3 %4 %5 %6 %7 %8 %9
@echo Off
Echo ========== Choose Your Action Center! (Requires Restart) ==========
Echo Windows 10: 0
Echo Windows 11: 1
Echo.
Echo Cancel: 2
Echo.
Set /p vibor="Selection: "
if "%vibor%"=="0" (
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Control Center" /v UseLiteLayout /t REG_DWORD /d 1 /f
) else if "%vibor%"=="1" (
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Control Center" /v UseLiteLayout /t REG_DWORD /d 0 /f
) else if "%vibor%"=="2" (
GOTO :EOF
)
taskkill /f /im explorer.exe
start explorer
@echo off
win 10
win 11
Last edited:
My Computer
System One
-
- OS
- Windows 11 Pro