@echo off
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
    echo Run as Administrator...
    goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    set params = %*:"=""
    echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"

    "%temp%\getadmin.vbs"
    rem del "%temp%\getadmin.vbs"
    exit /B
:gotAdmin

:main
cls
echo.
echo		[ 윈도우 초기 설정 도우미 v1.2.1 By Remiz ]
echo.
echo.
echo.
echo		1. 최대 절전 모드 켜기 [기본값]
echo.
echo		2. 최대 절전 모드 끄기
echo.
echo		3. 우클릭 매뉴 "제어판" 보이기
echo.
echo		4. 우클릭 매뉴 "제어판" 감추기 [기본값]
echo.
echo		5. 윈도우 디펜더 켜기 [기본값]
echo.
echo		6. 윈도우 디펜더 끄기
echo.
echo		7. 원드라이브[OneDrive] 제거
echo.
echo		8. 윈도우10 RS5 인증하기 (인증 전 필독 폴더 참조)
echo.
echo		9. StartIsBack++ 2.7.2 (시작메뉴) 설치하기
echo.
echo		0. 윈도우10 추천앱 자동설치 막기
echo.
set menu=
set /p menu=원하시는 작업 번호를 입력 후 엔터(Enter)키를 눌러주세요 : 
if "%menu%" == "1" goto make
if "%menu%" == "2" goto delete
if "%menu%" == "3" goto rightadd
if "%menu%" == "4" goto rightdel
if "%menu%" == "5" goto antion
if "%menu%" == "6" goto antioff
if "%menu%" == "7" goto one
if "%menu%" == "8" goto act
if "%menu%" == "9" goto sib
if "%menu%" == "0" goto stopapp

goto main

:make
powercfg -h on
pause
goto main

:delete
powercfg -h off
pause
goto main

:one
set x86="%SYSTEMROOT%\System32\OneDriveSetup.exe"
set x64="%SYSTEMROOT%\SysWOW64\OneDriveSetup.exe"
echo.
echo OneDrive 관련 프로세스를 닫는중...
echo.
taskkill /f /im OneDrive.exe > NUL 2>&1
ping 127.0.0.1 -n 5 > NUL 2>&1
echo OneDrive 제거중...
echo.
if exist %x64% (
%x64% /uninstall
) else (
%x86% /uninstall
)
ping 127.0.0.1 -n 5 > NUL 2>&1
echo Removing OneDrive leftovers...
echo.
rd "%USERPROFILE%\OneDrive" /Q /S > NUL 2>&1
rd "C:\OneDriveTemp" /Q /S > NUL 2>&1
rd "%LOCALAPPDATA%\Microsoft\OneDrive" /Q /S > NUL 2>&1
rd "%PROGRAMDATA%\Microsoft OneDrive" /Q /S > NUL 2>&1 
echo '바로가기'란의 OneDrive 제거중...
echo.
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f > NUL 2>&1
REG DELETE "HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f > NUL 2>&1
pause
goto main

:rightadd
reg add "HKEY_CLASSES_ROOT\DesktopBackground\Shell\Control Panel" /t REG_SZ /d "제어판" /f
reg add "HKEY_CLASSES_ROOT\DesktopBackground\Shell\Control Panel" /v "icon" /t REG_SZ /d "Control.exe" /f
reg add "HKEY_CLASSES_ROOT\DesktopBackground\Shell\Control Panel\command" /t REG_SZ /d "Control.exe" /f
pause
goto main

:rightdel
reg delete "HKEY_CLASSES_ROOT\DesktopBackground\Shell\Control Panel" /f
pause
goto main


:act
start %~dp01mp\act\"KMSAuto Net.exe"
pause
goto main

:sib
start %~dp01mp\start\"StartIsBack.exe"
pause
goto main

:antioff
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender" /v "DisableAntiSpyware" /t REG_DWORD /d "1" /f
pause
goto main

:antion
REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender" /v "DisableAntiSpyware" /f
pause
goto main

:stopapp
reg add "HKCU\Software\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsSpotlightFeatures" /t REG_DWORD /d "1" /f
reg add "HKCU\Software\Policies\Microsoft\Windows\CloudContent" /v "DisableThirdPartySuggestions" /t REG_DWORD /d "1" /f
pause
goto main

:clr
start %~dp01mp\clr\ccsetup.exe
pause
goto main

:exit
exit