@echo off
echo Checking for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
echo Permission check result: %errorlevel%
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"
echo Running created temporary "%temp%\getadmin.vbs"
timeout /T 2
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
pushd "%CD%"
CD /D "%~dp0"
echo Batch was successfully started with admin privileges
echo .
cls
GOTO:menu
:menu
Title Sandbox Yukleyici
echo Yuklemeden once verilerinizi kaydedin.
echo --------------------------------------------------
echo Kurulum Secenekleri?
echo 1 Yukle
echo 2 Kaldir
echo 3 Kapat
set /p uni= Seciminizi yapin:
if %uni% ==1 goto :in
if %uni% ==2 goto :un
if %uni% ==3 goto :ex
:in
cls
Title Sandbox Yukleme
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\*Containers*.mum >sandbox.txt
for /f %%i in ('findstr /i . sandbox.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del sandbox.txt
Dism /online /enable-feature /featurename:Containers-DisposableClientVM /LimitAccess /ALL /NoRestart
goto :remenu
:un
cls
Title Sandbox Kaldırma
pushd "%~dp0"
Dism /online /disable-feature /featurename:Containers-DisposableClientVM /NoRestart
dir /b %SystemRoot%\servicing\Packages\*Containers*.mum >sandbox.txt
for /f %%i in ('findstr /i . sandbox.txt 2^>nul') do dism /online /norestart /remove-package:"%SystemRoot%\servicing\Packages\%%i"
del sandbox.txt
goto :remenu
:remenu
cls
echo Bilgisayarı simdi yeniden baslatmak istiyor musunuz?
echo 1 Evet
echo 2 Hayır
set /p uni= Seçiminizi yapın:
if %uni% ==1 goto :re
if %uni% ==2 goto :ex
:re
shutdown /r /t 0 /f
goto :ex
:ex
exit