Перейти из форума на сайт.

НовостиФайловые архивы
ПоискАктивные темыТоп лист
ПравилаКто в on-line?
Вход Забыли пароль? Первый раз на этом сайте? Регистрация
Компьютерный форум Ru.Board » Операционные системы » Microsoft Windows » Disable Telemetry Windows 7 and next

Модерирует : KLASS, IFkO

 Версия для печати • ПодписатьсяДобавить в закладки
На первую страницук этому сообщениюк последнему сообщению

Открыть новую тему     Написать ответ в эту тему

Wu Tang



Silver Member
Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору

@echo off
title "Disable Windows 7/8/8.1 Telemetry [mod]"
endlocal & setlocal EnableDelayedExpansion
 
rem Script created by <github.com/tarampampam> # 2015
rem Github: <https://gist.github.com/tarampampam/a0db45fb0de5976300b1>
rem OS: Windows 7/8/8.1
rem Version 0.2.14
 
rem mod by dialmak
 
 
echo.
echo   ***************************************************************************
echo   *                                                                         *
echo   *      Disable Windows 7/8/8.1 Telemetry (+bonus) service [mod]           *
echo   *                                                                         *
echo   ***************************************************************************
echo   *                                                                         *
echo   * Script support arguments:                                               *
echo   *                                                                         *
echo   *   -t ^| -tasks     Do NOT disable tasks                                  *
echo   *   -s ^| -services  Do NOT disable services                               *
echo   *   -u ^| -updates   Do NOT disable automatic updates                      *
echo   *   -l ^| -log       Do NOT write messages to .log file                    *
echo   *   -e ^| -exit      Exit when work is complete                            *
echo   *                                                                         *
echo   *                                                                         *
echo   ***************************************************************************
echo   *                                                                         *
echo   *             PLEASE DISABLE YOUR ANTIVIRUS SOFTWARE BEFORE^^!              *
echo   *                                                                         *
echo   ***************************************************************************
echo.
 
set WriteLogFile=1
set ExitOnComplete=0
set DisableTasks=1
set DisableServices=1
set DisableAutomaticUpdates=1
set LogFilePath="%~f0.log"
set result=
 
rem Parse passed arguments to script
arse_passed_params
  if "%~1"=="" goto end_parse_passed_params
  if /i "%~1"=="-e"        set ExitOnComplete=1
  if /i "%~1"=="-exit"     set ExitOnComplete=1
  if /i "%~1"=="-t"        set DisableTasks=0
  if /i "%~1"=="-tasks"    set DisableTasks=0
  if /i "%~1"=="-s"        set DisableServices=0
  if /i "%~1"=="-services" set DisableServices=0
  if /i "%~1"=="-u"        set DisableAutomaticUpdates=0
  if /i "%~1"=="-updates"  set DisableAutomaticUpdates=0
  if /i "%~1"=="-l"        set WriteLogFile=0
  if /i "%~1"=="-log"      set WriteLogFile=0
  if /i "%~1"=="/e"        set ExitOnComplete=1
  if /i "%~1"=="/exit"     set ExitOnComplete=1
  if /i "%~1"=="/t"        set DisableTasks=0
  if /i "%~1"=="/tasks"    set DisableTasks=0
  if /i "%~1"=="/s"        set DisableServices=0
  if /i "%~1"=="/services" set DisableServices=0
  if /i "%~1"=="/u"        set DisableAutomaticUpdates=0
  if /i "%~1"=="/updates"  set DisableAutomaticUpdates=0
  if /i "%~1"=="/l"        set WriteLogFile=0
  if /i "%~1"=="/log"      set WriteLogFile=0  
  shift & goto parse_passed_params
:end_parse_passed_params
 
goto:checkPermissions
:begin
 
for /f "tokens=*" %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" /s^|find /i "ProfileList\S-"') do (
    for /f "tokens=2*" %%B In ('reg query "%%A" /s^|find /i "ProfileImagePath"') do if "%username%"=="%%~nC" set "sid_user=%%~nA"
)
 
if %DisableTasks%==1 (
  call:title "Disable some windows tasks.."
  for %%? in (
    "\Microsoft\Windows\Application Experience\AitAgent"
    "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser"
    "\Microsoft\Windows\Application Experience\ProgramDataUpdater"
    "\Microsoft\Windows\Autochk\Proxy"
    "\Microsoft\Windows\Customer Experience Improvement Program\Consolidator"
    "\Microsoft\Windows\Customer Experience Improvement Program\KernelCeipTask"
    "\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip"
    "\Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector"
    "\Microsoft\Windows\PI\Sqm-Tasks"
    "\Microsoft\Windows\Power Efficiency Diagnostics\AnalyzeSystem"
    "\Microsoft\Windows\Windows Error Reporting\QueueReporting"
    "\Microsoft\Windows\Maintenance\WinSAT"
    "\Microsoft\Windows\Media Center\ActivateWindowsSearch"
    "\Microsoft\Windows\Media Center\ConfigureInternetTimeService"
    "\Microsoft\Windows\Media Center\DispatchRecoveryTasks"
    "\Microsoft\Windows\Media Center\ehDRMInit"
    "\Microsoft\Windows\Media Center\InstallPlayReady"
    "\Microsoft\Windows\Media Center\mcupdate"
    "\Microsoft\Windows\Media Center\MediaCenterRecoveryTask"
    "\Microsoft\Windows\Media Center\ObjectStoreRecoveryTask"
    "\Microsoft\Windows\Media Center\OCURActivate"
    "\Microsoft\Windows\Media Center\OCURDiscovery"
    "\Microsoft\Windows\Media Center\PBDADiscovery"
    "\Microsoft\Windows\Media Center\PBDADiscoveryW1"
    "\Microsoft\Windows\Media Center\PBDADiscoveryW2"
    "\Microsoft\Windows\Media Center\PvrRecoveryTask"
    "\Microsoft\Windows\Media Center\PvrScheduleTask"
    "\Microsoft\Windows\Media Center\RegisterSearch"
    "\Microsoft\Windows\Media Center\ReindexSearchRoot"
    "\Microsoft\Windows\Media Center\SqlLiteRecoveryTask"
    "\Microsoft\Windows\Media Center\UpdateRecordPath"
  ) do call:disable_task %%?
)
 
if %DisableServices%==1 (
  call:title "Disable services.."
  for %%? in (
    "Diagtrack"
    "dmwappushservice"
    "WerSvc"
  ) do call:disable_service %%?
   
  set RegDataCollection="HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection"
  reg query !RegDataCollection!>nul 2>&1 & if %errorLevel%==0 (
    reg add !RegDataCollection! /v AllowTelemetry /t REG_DWORD /d 0 /f >nul
  )
    
    set RegDataCollection="HKLM\SOFTWARE\Microsoft\SQMClient\Windows"
  reg query !RegDataCollection!>nul 2>&1 & if %errorLevel%==0 (
    reg add !RegDataCollection! /v CEIPEnable /t REG_DWORD /d 0 /f >nul
  )
   
    set RegDataCollection="HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet"
  reg query !RegDataCollection!>nul 2>&1 & if %errorLevel%==0 (
    reg add !RegDataCollection! /v SpyNetReporting /t REG_DWORD /d 0 /f >nul
  )
   
    for /f "delims=" %%A in ('"wmic.exe path Win32_UserAccount where (Disabled='False' and Status='OK') get sid /Value" 2^>nul') do for /f "tokens=2 delims==" %%B in ("%%A") do (call :RegistryUser "%%B")
    
)
 
if %DisableAutomaticUpdates%==1 (
  call:title "Disable automatic windows update ^(make search, but you must manually select updates to install^)"
  set RegeditRoot="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update"
  reg add !RegeditRoot! /v AUOptions /t REG_DWORD /d 1 /f>nul
  reg add !RegeditRoot! /v IncludeRecommendedUpdates /t REG_DWORD /d 0 /f>nul
)
 
goto:end
 
:log
  set message=%~1
  set type=%~2
  if [!type!] EQU [] (
    set type=%time%
  )
  echo [!type!] %message%
  if %WriteLogFile%==1 ( if [%LogFilePath%] NEQ [] (
    echo [!type!] %message%>>%LogFilePath% 2>&1
  ))
  exit /b
   
:title
  set title=%~1
  echo.
  echo [i] %title%
  if %WriteLogFile%==1 ( if [%LogFilePath%] NEQ [] (
    echo.>>%LogFilePath% 2>&1
    echo [i] %title%>>%LogFilePath% 2>&1
  ))
  exit /b
 
:checkPermissions
  if exist %SystemRoot%\System32\fsutil.exe (
    fsutil dirty query %systemdrive%>nul 2>&1
  ) else (
    net session >nul 2>&1
  )
  if %errorLevel%==0 (
    goto:begin
  ) else (
    call:log "[Failure] Need administrative permissions"
    goto:end
  )
  exit /b
   
   
isable_task
  set task_name=%~1
  call:log "Disable task %task_name%"
  schtasks /Change /TN "%task_name%" /DISABLE>nul 2>&1
  exit /b
 
isable_service
  set service_name=%~1
  set errors_counter=0
  call:log "Disable service '%service_name%'"
  sc query "%service_name%">nul
  if %errorlevel% NEQ 1060 (
    sc config "!service_name!" start= disabled>nul
    if %errorlevel% NEQ 0 set /a errors_counter=errors_counter+1
    sc stop "!service_name!">nul
    if %errorlevel% NEQ 0 set /a errors_counter=errors_counter+1
    if %errors_counter%==0 (
      call:log "Service '!service_name!' disabled successful"
    )
  ) else set /a errors_counter=errors_counter+1 & call:log "Service '!service_name!' not installed"
  exit /b
 
 
:end
  if %ExitOnComplete%==0 (
    call:title "Exit after 5 seconds, or press any key for exit now"
    timeout /t 5>nul 2>&1
    )
 endlocal
 echo on
 goto :EOF
 
:RegistryUser
  set "sid_user=%~1"  
  set RegWindowsReporting="HKEY_USERS\%sid_user%\Software\Microsoft\Windows\Windows Error Reporting"  
  reg query !RegWindowsReporting!>nul 2>&1 & if %errorLevel%==0 (
    reg add !RegWindowsReporting! /v Disabled /t REG_DWORD /d 1 /f >nul 2>nul
  )
  goto :EOF  

Всего записей: 3788 | Зарегистр. 15-10-2007 | Отправлено: 04:16 11-12-2023
Открыть новую тему     Написать ответ в эту тему

На первую страницук этому сообщениюк последнему сообщению

Компьютерный форум Ru.Board » Операционные системы » Microsoft Windows » Disable Telemetry Windows 7 and next


Реклама на форуме Ru.Board.

Powered by Ikonboard "v2.1.7b" © 2000 Ikonboard.com
Modified by Ru.B0ard
© Ru.B0ard 2000-2024

BitCoin: 1NGG1chHtUvrtEqjeerQCKDMUi6S6CG4iC

Рейтинг.ru