@echo off
if "%1"=="whatis" echo Manage administrative policies&goto :eof
setlocal EnableDelayedExpansion
title Welcome %user% to %OSname%
if not "%user%"=="%adname%" (
cls
echo.
echo Cannot execute this command
echo.
echo You don't have proper priviledges to
echo access this command
echo.
pause
exit
)
set "adpasswd="
:geditor
cls
color %rndcolor%
if "%adpasswd%"=="$exit" exit
if not "%adpasswd%"=="%adminpass%" (
color f9
title Password confirmation
echo.
echo Please enter %adname%'s password to continue:
echo ^(type $exit to quit^)
echo.
set/padpasswd=
goto geditor
)
if exist config_os\Policies.settings for /f "eol=: delims=," %%a in (config_os\Policies.settings) do set %%a
title Local system policies
Echo.
Echo System policies
Echo.
echo 1. Set computer policies
echo 2. Clear computer policies
echo 3. Save computer policies
echo 4. View computer policies
Echo 5. Go back to start
Echo.
set /p answer=Your choice:
if "%answer%"=="5" exit
if "%answer%"=="1" set number=1&goto editgp
if "%answer%"=="2" goto remgp
if "%answer%"=="3" goto savegp
if "%answer%"=="4" goto viewgp
goto geditor

:viewgp
cls
echo.
echo Current system policies
echo.
if "%recoveryaccess%"=="no" echo Prevent any access to recovery or safe mode : ENABLED
if "%recoveryaccess%"=="yes" echo Prevent any access to recovery or safe mode : DISABLED
if "%recoveryaccess%"=="" echo Prevent any access to recovery or safe mode : UNCONFIGURED
if "%ecmdaccess%"=="no" echo Prevent any access to eCMD : ENABLED
if "%ecmdaccess%"=="yes" echo Prevent any access to eCMD : DISABLED
if "%ecmdaccess%"=="" echo Prevent any access to eCMD : UNCONFIGURED
if "%gunlimited%"=="no" echo Remove guest limitations : ENABLED
if "%gunlimited%"=="yes" echo Remove guest limitations : DISABLED
if "%gunlimited%"=="" echo Remove guest limitations : UNCONFIGURED
if "%slogo%"=="no" echo Don't show %OSname% logo : ENABLED
if "%slogo%"=="yes" echo Don't show %OSname% logo : DISABLED
if "%slogo%"=="" echo Don't show %OSname% logo : UNCONFIGURED
if "%capps%"=="no" echo Disable custom applications : ENABLED
if "%capps%"=="yes" echo Disable custom applications : DISABLED
if "%capps%"=="" echo Disable custom applications : UNCONFIGURED
if "%live%"=="true" echo Live mode : ENABLED
if "%live%"=="false" echo Live mode : DISABLED
if "%live%"=="" echo Live mode : UNCONFIGURED
if "%sos%"=="true" echo Debug mode : ENABLED
if "%sos%"=="false" echo Debug mode : DISABLED
if "%sos%"=="" echo Debug mode : UNCONFIGURED
echo.
pause
goto geditor

:remgp
@echo.recoveryaccess=>log_os\Afterun.Quicksetup
@echo.ecmdaccess=>>log_os\Afterun.Quicksetup
@echo.gunlimited=>>log_os\Afterun.Quicksetup
@echo.slogo=>>log_os\Afterun.Quicksetup
@echo.capps=>>log_os\Afterun.Quicksetup
@echo.live=>>log_os\Afterun.Quicksetup
@echo.sos=>>log_os\Afterun.Quicksetup
set "recoveryaccess="
set "ecmdaccess="
set "gunlimited="
set "slogo="
set "capps="
set "live="
set "sos="
cls
echo.
echo Policies reset
echo.
pause
goto geditor

:savegp
@echo.::This file contains different system policies>>config_os\Policies.settings
@echo.::>>config_os\Policies.settings
@echo.::>config_os\Policies.settings
@echo.::Saved at: %date% %time%>>config_os\Policies.settings
@echo.::>>config_os\Policies.settings
@echo.recoveryaccess=%recoveryaccess%,>>config_os\Policies.settings
@echo.ecmdaccess=%ecmdaccess%,>>config_os\Policies.settings
@echo.gunlimited=%gunlimited%,>>config_os\Policies.settings
@echo.slogo=%slogo%,>>config_os\Policies.settings
@echo.capps=%capps%,>>config_os\Policies.settings
@echo.live=%live%,>>config_os\Policies.settings
@echo.sos=%sos%,>>config_os\Policies.settings
cls
echo.
echo Policies were saved
echo.
pause
goto geditor

:editgp
cls
Echo.
Echo Set policy
Echo.
Echo 1. Prevent any access to recovery or safe mode
Echo 2. Prevent any access to eCMD
Echo 3. Remove guest limitations
Echo 4. Don't show %OSname% logo
Echo 5. Disable custom applications
Echo 6. Live mode
Echo 7. Enable debug mode to show information
Echo 8. Go back
Echo.
set /p answer=Your selection:
cls
if "%answer%"=="1" goto sfrecsetting
if "%answer%"=="2" goto ecmdsetting
if "%answer%"=="3" goto guestsetting
if "%answer%"=="4" goto logosetting
if "%answer%"=="5" goto customsetting
if "%answer%"=="6" goto livesettings
if "%answer%"=="7" goto sossetting
if "%answer%"=="8" goto geditor
goto editgp


:sfrecsetting
Echo.
Echo Prevent access to recovery or safe mode
Echo.
Echo This will prevent access to recovery or safe
echo mode even, if you have a admin password.
Echo.
Echo This will also disable access to recovery
echo mode from desktop.
Echo.
Echo * This can improve performance
Echo * You'll not have access to make backups,
echo wipe user data and wipe cache
Echo.
set /p qinput=Apply? (Y/N)
if "%qinput%"=="n" goto geditor
if "%qinput%"=="N" goto geditor
@echo.recoveryaccess=no>>log_os\Afterun.Quicksetup
set recoveryaccess=no
goto geditor

:ecmdsetting
Echo.
Echo Prevent any access to eCMD
Echo.
Echo This will prevent users access to eCMD.
echo This will also prevent administrator
echo access to eCMD
Echo.
set /p qinput=Apply? (Y/N)
if "%qinput%"=="n" goto geditor
if "%qinput%"=="N" goto geditor
@echo.ecmdaccess=no>>log_os\Afterun.Quicksetup
set ecmdaccess=no
goto geditor

:guestsetting
Echo.
Echo Remove guest limitations
Echo.
Echo This will allow guest to do anything. This
echo will also allow guest to change user
Echo accounts and access to eCMD. But guest
echo still cannot factory reset.
Echo.
set /p qinput=Apply? (Y/N)
if "%qinput%"=="n" goto geditor
if "%qinput%"=="N" goto geditor
@echo.gunlimited=yes>>log_os\Afterun.Quicksetup
set gunlimited=yes
goto geditor

:logosetting
Echo.
Echo Don't show %OSname% logo
Echo.
Echo If you enable this setting, you won't see %OSname%
echo logo, when you boot up %OSname%, if you shutdown
echo it or if you log off.
Echo.
Echo This will not delete the %OSname% logo file.
Echo.
Echo * This can improve performance
set /p qinput=Apply? (Y/N)
if "%qinput%"=="n" goto geditor
if "%qinput%"=="N" goto geditor
@echo.slogo=no>>log_os\Afterun.Quicksetup
set slogo=no
goto geditor

:customsetting
Echo.
Echo Disable custom apps
Echo.
Echo This will ignore the 'custom' command and if you
echo enter the app name, it will not start.
Echo.
Echo * This will not delete your custom apps
echo * Application data won't be affected
set /p qinput=Apply? (Y/N)
if "%qinput%"=="n" goto geditor
if "%qinput%"=="N" goto geditor
@echo.capps=no>>log_os\Afterun.Quicksetup
set capps=no
goto geditor

:livesettings
Echo.
Echo Enable live mode
Echo.
Echo Locks current settings so that you won't be able
echo to save them when shutting down.
Echo.
Echo * Current settings won't be deleted
Echo * This can improve performance
Echo.
set /p qinput=Apply? (Y/N)
if "%qinput%"=="n" goto geditor
if "%qinput%"=="N" goto geditor
@echo.live=true>>log_os\Afterun.Quicksetup
set live=true
goto geditor

:sossetting
Echo.
Echo Enable debug mode to get information
Echo.
Echo This will allow user get information about what
Echo is going on and last command before failure.
Echo.
Echo * Information will be showed in the title bar
Echo * Does not affect performance
set /p qinput=Apply? (Y/N)
if "%qinput%"=="n" goto geditor
if "%qinput%"=="N" goto geditor
@echo.sos=true>>log_os\Afterun.Quicksetup
set sos=true
goto geditor