강좌 / 팁

윈 도 우 윈도우10 RS 자동최적화 bat(배치파일)

2017.09.16 14:41

제로데이 조회:10616 추천:14

Notice.bat


1. 원드라이브 삭제

2. 윈도우 개인정보 전송 차단

3. 윈도우 초기시작시 앱 자동설치 차단

 

3개의 내용을 하나로 합친거뿐입니다.

일일히 최적화 하시는 분들도 계실까봐 올려봅니다.

 

자동앱설치 막기는 윈도우10부터는 초기 포맷설치시 자동으로 앱들을 설치하길래 블로그 참조해서 넣었습니다.

 


 

출처 

https://github.com/TERRAOperative/OneDrive-Uninstaller/blob/master/OneDrive%20Uninstaller%20v1.2.bat

http://pcgeek.kr/index.php?mid=review&page=14&listStyle=gallery&document_srl=241973

http://slic.tistory.com/1200

 

 


 

@echo OFF

@REM 컬러 텍스트에 대한 변수 설정
SETLOCAL EnableDelayedExpansion
for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do     rem"') do (
  set "DEL=%%a"
)

   echo ------Windows 10 RS2 원드라이브+개인정보전송+자동앱설치 차단------
   echo.
   
@rem 관리자권한 확인하는 코드
NET SESSION >nul 2>&1
IF %ERRORLEVEL% EQU 0 (


   echo        Administrator Privileges Detected!
   echo.
) ELSE (

   echo.
   call :colorEcho 0C "########### ERROR - ADMINISTRATOR PRIVILEGES REQUIRED #############"
   echo.
   call :colorEcho 0C "#                                                                 #"
   echo.
   call :colorEcho 0C "#"
   call :colorEcho 07 "    This script must be run as administrator to work properly."
   call :colorEcho 0C "    #"
   echo.
   call :colorEcho 0C "#"
   call :colorEcho 07 "    If you're seeing this after clicking on a start menu icon,"
   call :colorEcho 0C "   #"
   echo.
   call :colorEcho 0C "#"
   call :colorEcho 07 "  then right click on the file and select 'Run As Administrator'"
   call :colorEcho 0C " #"
   echo.
   call :colorEcho 0C "#                                                                 #"
   echo.
   call :colorEcho 0C "###################################################################"
   echo.
   echo.

   PAUSE
   EXIT /B 1
)

   echo -----------------------------------------------
   call :colorEcho 0C "                    WARNING"
   echo.
   call :colorEcho 0C "  This script will completely and permanently"
   echo.
   call :colorEcho 0C "      remove OneDrive from your computer."
   echo.
   call :colorEcho 0C "        Make sure all OneDrive documents"   
   echo.
   call :colorEcho 0C "       that are stored locally are fully"
   echo.
   call :colorEcho 0C "          backed up before proceeding."   
   echo.
   call :colorEcho 0C "          문제가 생기더라도 본인 책임입니다."   
   echo.
   echo -----------------------------------------------
   echo.

   SET /P M=  Press 'Y' to continue or any other key to exit. 
    if %M% ==Y goto PROCESSKILL
    if %M% ==y goto PROCESSKILL

   EXIT /B 1


@rem Terminate any OneDrive process
:PROCESSKILL
   echo.
   echo Terminating OneDrive process.
   
taskkill /f /im OneDrive.exe


@rem Detect if OS is 32 or 64 bit
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set OS=32BIT || set OS=64BIT

if %OS%==32BIT GOTO 32BIT
if %OS%==64BIT GOTO 64BIT


@rem Uninstall OneDrive app
:32BIT
   echo.
   echo This is a 32-bit operating system.
   echo Removing OneDrive setup files.
   
%SystemRoot%\System32\OneDriveSetup.exe /uninstall
GOTO CLEAN

:64BIT
   echo.
   echo This is a 64-bit operating system.
   echo Removing OneDrive setup files.
   
%SystemRoot%\SysWOW64\OneDriveSetup.exe /uninstall
GOTO CLEAN


@rem Clean and remove OneDrive remnants
:CLEAN
   echo.
   echo Removing remaining OneDrive folders.
   
   rd "%UserProfile%\OneDrive" /Q /S
   rd "%LocalAppData%\Microsoft\OneDrive" /Q /S
   rd "%ProgramData%\Microsoft OneDrive" /Q /S
   rd "C:\OneDriveTemp" /Q /S
   
   echo.
   call :colorEcho 0C "If you see 'access denied' errors here, reboot and run this batch file again."
   echo.

@rem Delete and remove OneDrive in file explorer folder tree registry key
   echo.
   echo Removing OneDrive registry keys.
   
   IF EXIST "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" REG Delete "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f
   IF EXIST "HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" REG Delete "HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f
   REG ADD "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /v System.IsPinnedToNameSpaceTree /d "0" /t REG_DWORD /f
   
   echo.
   echo OneDrive Uninstall and cleaning completed.
   echo.


echo.
echo 불필요한 스케줄러 끄기...
echo.


echo.
echo Microsoft Compatibility Appraiser
echo - MS 사용자 환경 개선 프로그램에 옵트인(opt in)한 경우 프로그램 원격 분석 정보를 수집합니다.

schtasks.exe /Change /TN "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" /Disable


echo.
echo ProgramDataUpdater
echo - MS 사용자 환경 개선 프로그램에 설정된 경우 프로그램 원격 분석 정보를 수집합니다.

schtasks.exe /Change /TN "\Microsoft\Windows\Application Experience\ProgramDataUpdater" /Disable


echo.
echo StartupAppTask
echo - 시작 항목을 검색하고 시작 항목이 너무 많을 경우 사용자에게 알림을 표시합니다.

schtasks.exe /Change /TN "\Microsoft\Windows\Application Experience\StartupAppTask" /Disable


echo.
echo Consolidator
echo - Windows 사용자 환경 개선 프로그램에 참여하기로 동의한 경우 이 작업은 사용 데이터를 보냅니다.

schtasks.exe /Change /TN "\Microsoft\Windows\Customer Experience Improvement Program\Consolidator" /Disable


echo.
echo KernelCeipTask
echo - 커널 CEIP(사용자 환경 개선 프로그램) 작업은 시스템에 대한 추가 정보를 수집하고 이 데이터를 보냅니다.

schtasks.exe /Change /TN "\Microsoft\Windows\Customer Experience Improvement Program\KernelCeipTask" /Disable


echo.
echo UsbCeip
echo - USB CEIP(사용자 환경 개선 프로그램) 작업은 사용자 컴퓨터에 대해 USB(범용 직렬 버스) 관련 정보를 수집.

schtasks.exe /Change /TN "\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" /Disable


echo.
echo QueueReporting
echo - 진행할 Windows 오류 보고 작업에서 보고서를 큐에 넣었습니다.

schtasks.exe /Change /TN "\Microsoft\Windows\Windows Error Reporting\QueueReporting" /Disable


echo.
echo.
echo 개인정보 보호...
echo.


echo.
echo AllowTelemetry
echo - 윈도우에서 피드백을 통해 개인정보가 보내지는 것을 차단한다.

powershell.exe -command "Get-Service DiagTrack | Set-Service -StartupType Disabled"
powershell.exe -command "Get-Service dmwappushservice | Set-Service -StartupType Disabled"
reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection\ /v AllowTelemetry /t REG_DWORD /d 0 /f
:: reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" /v "AllowTelemetry" /t REG_DWORD /d "0" /f


echo.
echo NumberOfSIUFInPeriod
echo - 윈도우에서 내 피드백 요청 안함.

reg add "HKCU\SOFTWARE\Microsoft\Siuf\Rules" /v "NumberOfSIUFInPeriod" /t REG_DWORD /d "0" /f
reg delete "HKCU\SOFTWARE\Microsoft\Siuf\Rules" /v "PeriodInNanoSeconds" /f

echo.
echo Adverstising ID
echo - 앱에서 광고 ID를 사용하여 광고를 표시하는것을 끄기

reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /v "Enabled" /t REG_DWORD /d "0" /f
reg delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /v "id" /f
:: reg add "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /v "Enabled" /t REG_DWORD /d "0" /f
:: reg delete "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /v "id" /f


echo.
echo HttpAcceptLanguageOptOut
echo - 웹에서 내 언어 목록에 액세스 끄기

reg add "HKCU\Control Panel\International\User Profile" /v "HttpAcceptLanguageOptOut" /t REG_DWORD /d "1" /f


:: Send Miccrosoft info about how ... (내 쓰기 방법에 대한 정보 보냄... Win10 RS2에서 없어짐)
:: reg add "HKCU\SOFTWARE\Microsoft\Input\TIPC" /v "Enabled" /t REG_DWORD /d "0" /f


echo.
echo DisableThirdPartySuggestions
echo - 윈도우10 자동으로 앱설치되는거 막기

reg add "HKCU\Software\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsSpotlightFeatures" /t REG_DWORD /d "1" /f


echo.
echo DisableThirdPartySuggestions
echo - 윈도우10 자동으로 앱설치되는거 막기

reg add "HKCU\Software\Policies\Microsoft\Windows\CloudContent" /v "DisableThirdPartySuggestions" /t REG_DWORD /d "1" /f
echo.
echo.

   PAUSE
   echo 고생하셨습니다, 만약 제대로 되지 않았다면 재부팅후 다시 실행해주세요....
   PING -n 5 127.0.0.1>nul
   EXIT /B 1

   
@rem Settings for text colour

:colorEcho
echo off
<nul set /p ".=%DEL%" > "%~2"
findstr /v /a:%1 /R "^$" "%~2" nul
del "%~2" > nul 2>&1i

번호 제목 글쓴이 조회 추천 등록일
[공지] 강좌 작성간 참고해주세요 gooddew - - -
3900 소프트웨어| 성경 베들레헴_4.32_불필요 파일 삭제하기 [13] 좋은이웃 1666 5 04-01
3899 소프트웨어| PE 해상도 변경하기 [5] 좋은이웃 2226 13 04-01
3898 서버 / IT| Windows 내 파일을 누가 삭제 했을까? [2] 펨토 1887 6 03-31
3897 윈 도 우| 가끔쓰는 도스 명령어 대신 메뉴로 관리하자(BAT포함) [8] 멀더는외계 2142 20 03-31
3896 윈 도 우| 내가 접속한 와이파이 비밀번호 알아내기(Bat파일 포함) [6] 멀더는외계 2353 4 03-31
3895 서버 / IT| 윈도우 보안 취약점 따라하기 및 스크립트 만들기 [8] 펨토 1529 7 03-28
3894 소프트웨어| [Tip] 윈도우용 PuTTY 설정 백업 [3] asklee 1092 2 03-28
3893 윈 도 우| 유니버설 미디어 생성 도구 - Windows 10 21H1 지원 도구 [3] VₑₙᵤₛG 1650 8 03-27
3892 윈 도 우| bios 부팅과 uefi 부팅 기본개념 [4] 영구당 3362 6 03-25
3891 윈 도 우| 할당되지 않은 공간...1MB? [4] 밤이슬216 2220 5 03-24
3890 소프트웨어| Total commander 에서 검색된 파일들을 폴더 구조와 함께 ... [8] 줄리아니 1177 6 03-22
3889 소프트웨어| 디펜터에서 화일 바이러스 잡을경우 해결방법 [1] 조랑말 2159 6 03-20
3888 소프트웨어| 4K UHD HDR 비지원 동영상 플레시 화면이 물빠짐현상 해결방법 [2] 조랑말 1491 1 03-20
3887 모 바 일| [Tip] 카카오톡 흔들어 QR 코드 생성하기 [3] asklee 2759 10 03-15
3886 소프트웨어| WinNTSetup.exe에 소소한 팁들 [18] suk 3470 25 03-09
3885 윈 도 우| 절전모드 바로가기 3형제 [6] suk 2187 8 03-09
3884 윈 도 우| 윈도우 10 설정편 Tips (보완) [12] 뉴썬 6064 18 03-08
3883 윈 도 우| 절전모드가 자동 해제되는 경우 극약 처방 [17] suk 2035 5 03-03
3882 기 타| 구글 드라이브 대역폭 제한으로 사본 만들기가 안될때 [8] Nick 2493 6 03-01
3881 소프트웨어| Firefox 86.0의 새로운 기능과 변경된 내용 [6] VₑₙᵤₛG 1702 4 02-24
XE1.11.6 Layout1.4.8