Completely eradicate Telemetry, Defender, One drive, Cortana (and other things).

Discussion in 'Windows 10' started by T-S, Aug 5, 2015.

  1. spreizu

    spreizu MDL Novice

    Jun 7, 2013
    4
    0
    0
    #81 spreizu, Aug 12, 2015
    Last edited by a moderator: Apr 20, 2017
    You are working with an image right? Just a few hours ago I removed these packages using IWT on Online image:
    Code:
    install_wim_tweak.exe /o /c Microsoft-OneCore-AppRuntime-xbox /r
    install_wim_tweak.exe /o /c Microsoft-Xbox /r
    install_wim_tweak.exe /o /c Microsoft-OneCore-AppRuntime-WOW64-xbox /r
    install_wim_tweak.exe /o /c Microsoft-OneCore-Networking-XboxLive /r
    install_wim_tweak.exe /o /c Microsoft-Windows-Client-Drivers-xbox /r
    install_wim_tweak.exe /o /c Microsoft-Windows-Client-Features-Package-AutoMerged-xbox /r
    install_wim_tweak.exe /o /c Microsoft-Windows-Client-Features-WOW64-Package-AutoMerged-xbox /r
    install_wim_tweak.exe /o /c Microsoft-Windows-OneDrive /r
    install_wim_tweak.exe /o /c Microsoft-WindowsFeedback /r
    After a restart Windows configured something and all went well. Just did sfc /scannow (everything OK) and tried changing optional features (enabled/disabled telnet, WMP) - also OK. Maybe it has something to do with offline images?

    However I do have a question about "Metro" Apps - if I remove them through PS, they get deleted, but return after a restart (except "System" Apps such as Xbox). Is there a way for these not to get reinstalled?
     
  2. KNARZ

    KNARZ MDL Addicted

    Oct 9, 2012
    895
    482
    30
    Yes working with mounted images not online.
    Appx Issus maybe related to -AllUser(s?) switch?

    Or just Remove them with DISM.
     
  3. beemoe2

    beemoe2 MDL Novice

    Dec 3, 2014
    1
    0
    0
    But why, I don't get it. Some of the best stuff..
     
  4. rubik

    rubik MDL Novice

    Apr 30, 2009
    9
    0
    0
    #84 rubik, Aug 13, 2015
    Last edited by a moderator: Apr 20, 2017
    Stupid question (sorry!):

    What's the difference between these two and is one "better" than the other?

    Code:
    PS C:\> DISM /Online /Remove-AppxPackage /PackageName:$Package
    PS C:\> DISM /Online /Remove-ProvisionedAppxPackage /PackageName:$Package
    Thanks in advance!
     
  5. KNARZ

    KNARZ MDL Addicted

    Oct 9, 2012
    895
    482
    30
    #85 KNARZ, Aug 13, 2015
    Last edited by a moderator: Apr 20, 2017
    1) Pure PS
    2) Pure DISM

    This is right:
    Code:
    PS C:\>Remove-AppxPackage /PackageName:$Package
    C:\> DISM /Online /Remove-ProvisionedAppxPackage /PackageName:$Package

    BTW here is my quick and dirty script if anybody is interessted.

    Code:
    @echo off & cls
    call "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\DandISetEnv.bat"
    
    setlocal EnableDelayedExpansion
    
    set Text=echo. & echo. & echo
    set Resources=Resources
    set Tools=%Resources%\_Tools
    set FoD=%Resources%\FoD
    set Lists=%Resources%\Lists
    set PPKGs=%Resources%\ProvisioningPackages
    set Mount=%Resources%\_Mount
    set DISMCmd=dism.exe /English /Image:"%Mount%"
    set OriginalWIM=enterprise10_original.wim
    set WIMFile=enterprise10.wim
    set Index=1
    set VHD=%SystemDrive%\VHD
    
    call :PrepareTasks
    call :MountImage
    call :AddPackages
    call :ConfigFeatures
    call :RemovePackages
    call :RemoveAppx
    call :UnmountImage
    call :ExportImage
    call :PostTasks
    
    echo Done...
    pause > nul
    exit /b
    
    
    :---------------------------------------------------
    :Subroutine
    :---------------------------------------------------
    :PrepareTasks
    echo Prepare Actions.........
    if exist "%Resources%\%WIMFile%" (del "%Resources%\%WIMFile%")
    copy "%Resources%\%OriginalWIM%" "%Resources%\%WIMFile%"
    goto :EOF
    
    
    :MountImage
    %Text% Mount Image.........
    dism.exe /English /Mount-Image /ImageFile:"%Resources%\%WIMFile%" /Index:%Index% /MountDir:"%Mount%"
    goto :EOF
    
    
    :AddPackages
    %Text% Add Features.........
    %DISMCmd% /Add-Package /PackagePath:"%FoD%"
    %DISMCmd% /Add-ProvisioningPackage /PackagePath:"%PPKGs%\DefaultStartMenuLayout.ppkg"
    %DISMCmd% /Add-ProvisioningPackage /PackagePath:"%PPKGs%\Settings.ppkg"
    ::%DISMCmd% /Add-ProvisioningPackage /PackagePath:"%PPKGs%\FeaturesOnDemand.ppkg"
    ::%DISMCmd% /Add-ProvisioningPackage /PackagePath:"%PPKGs%\Z30_Drivers.ppkg"
    goto :EOF
    
    
    :RemoveAppx
    %Text% Remove Apps(x).........
    for /f "usebackq" %%i in ("%Lists%\_RemoveAppx.txt") do (%DISMCmd% /Remove-ProvisionedAppxPackage /PackageName:%%i)
    goto :EOF
    
    
    :ConfigFeatures
    %Text% Config Features.........
    call :CreateList "FeatureName" "_FeatureDisable.txt"
    %DISMCmd% /Disable-Feature %Component%
    call :CreateList "FeatureName" "_FeatureEnable.txt"
    %DISMCmd% /Enable-Feature %Component%
    goto :EOF
    
    
    :RemovePackages
    %Text% Remove Components.........
    for /f "usebackq" %%i in ("%Lists%\_RemoveComponents.txt") do ("%Tools%\install_wim_tweak.exe" /n /p "%Mount%" /c "%%i")
    call :CreateList "PackageName" "_RemoveComponents.txt"
    %DISMCmd% /Remove-Package %Component%
    goto :EOF
    
    
    :UnmountImage
    %Text% Unmount Image.........
    dism.exe /English /Unmount-Image /MountDir:"%Mount%" /Commit /CheckIntegrity
    goto :EOF
    
    
    :ExportImage
    %Text% Export Image.........
    ren "%Resources%\%WIMFile%" "CommitedWIM.wim"
    dism.exe /English /Export-Image /SourceImageFile:"%Resources%\CommitedWIM.wim" /SourceIndex:%Index% /DestinationImageFile:"%Resources%\%WIMFile%" /CheckIntegrity
    goto :EOF
    
    
    :PostTasks
    %Text% Post Install.........
    del "%Resources%\CommitedWIM.wim"
    if exist "%VHD%\%WIMFile%" (del "%VHD%\%WIMFile%")
    move "%Resources%\%WIMFile%" "%VHD%\"
    goto :EOF
    
    
    echo. & echo All Done...
    pause > nul
    exit /b
    
    
    
    :------------------------------------------------
    :Sub-Subroutine
    :------------------------------------------------
    :CreateList
    set Component=
    for /f "usebackq" %%i in ("%Lists%\%~2") do set Component=!Component! /%~1:%%i
    goto :EOF
    
    
    :------------------------------------------------
    :OLD - Not Used
    :------------------------------------------------
    set Package=
    set Temp1=
    for /f %%i in (%Lists%\%~2) do (
    set Temp1=/%~1:%%i
    set Package=!Package! !Temp1!
    )
    
    Structure
    Code:
    Resources
    
    |   enterprise10_original.wim
    |   
    +---FoD
    |       Microsoft-Windows-LanguageFeatures-Fonts-PanEuropeanSupplementalFonts-Package.cab
    |       Microsoft-Windows-NetFx3-OnDemand-Package.cab
    |       
    +---Lists
    |       _FeatureDisable.txt
    |       _FeatureEnable.txt
    |       _RemoveAppx.txt
    |       _RemoveComponents.txt
    |                       
    +---ProvisioningPackages
    |       DefaultStartMenuLayout.ppkg
    |       FeaturesOnDemand.ppkg
    |       Settings.ppkg
    |       Z30_Drivers.ppkg
    |       
    +---Updates
    |   |   Windows10.0-KB3074678-x64.cab
    |   |   Windows10.0-KB3074686-x64.cab
    |   |   Windows10.0-KB3081424-x64.cab
    |   |   
    |   \---Optional
    |           Windows10.0-KB3081704-x64.cab
    |           
    +---_Mount
    \---_Tools
            install_wim_tweak.exe
    
     
  6. Thrall

    Thrall MDL Novice

    Jan 29, 2012
    12
    0
    0
    That`s nice if you`re a member but they don`t allow downloading or viewing of attachments
     
  7. RADITZDJ

    RADITZDJ MDL Member

    Jun 24, 2011
    161
    36
    10
    I'm using DISM.exe
    What is the DISM syntax for that above for OFFLINE editing install.wim ?

    I can't find the packages such as this one :
    Microsoft-Windows-OneDrive-Setup-Package~31bf3856ad364e35~amd64~~10.0.10240.16384

    The package that listed using :
    dism /image:c:\{mount directory} /Get-Packages

    Is this one (just for package example) :
    Microsoft-Windows-DiagTrack-Internal-Package~31bf3856ad364e35~x86~~10.0.10240.16384

    And this succesfully removed.

    But how remove the rest in the quote box above using DISM?
     
  8. T-S

    T-S MDL Guru

    Dec 14, 2012
    3,984
    1,331
    120
    You have to unhide the packages first.

    The whole package list is over 1800 lines...
     
  9. RADITZDJ

    RADITZDJ MDL Member

    Jun 24, 2011
    161
    36
    10
    DISM command syntax please?
     
  10. T-S

    T-S MDL Guru

    Dec 14, 2012
    3,984
    1,331
    120
    #92 T-S, Aug 14, 2015
    Last edited: Aug 14, 2015
    (OP)

    Not sure if there is a DISM command to unhide the packages.

    Use install_wim_tweak.exe /p <MountPath> /l
     
  11. RADITZDJ

    RADITZDJ MDL Member

    Jun 24, 2011
    161
    36
    10
    So there is no DISM command to Unhide packages? :(
     
  12. T-S

    T-S MDL Guru

    Dec 14, 2012
    3,984
    1,331
    120

    I'm not aware of it. Which doesn't necessarily mean it doesn't exist.
     
  13. Supern00b

    Supern00b MDL Addicted

    Dec 30, 2010
    728
    540
    30
    Ok this works, BUT....

    I've still got the search glass on the taskbar (clicking on it does not do anything).
    And the OneDrive icon still sits in the explorer window.
    It would be nice to delete both items, it's something cosmetic perhaps.

    Cheers.
     
  14. T-S

    T-S MDL Guru

    Dec 14, 2012
    3,984
    1,331
    120
    #96 T-S, Aug 14, 2015
    Last edited: Aug 14, 2015
    (OP)
    Just hide it right clicking on the taskbar

    For the icon there are a lot of threads that explain how to delete it.

    Or, if your user is fresh, just create a new user then delete the old one.
     
  15. Supern00b

    Supern00b MDL Addicted

    Dec 30, 2010
    728
    540
    30
    That worked. Icon is now hidden and the OneDrive icon removed by registry tweak.

    Cheers.
     
  16. RADITZDJ

    RADITZDJ MDL Member

    Jun 24, 2011
    161
    36
    10
    After I remove the packages OFFLINE and then clean install
    How do I know (how to check) that my machine still contact (connection leak) to MS?
    I can't figured out TCPView result meaning o_O