1. roedel

    roedel MDL Junior Member

    Jun 3, 2010
    80
    54
    0
    #21721 roedel, Nov 30, 2021
    Last edited: Nov 30, 2021
    I´m using this

    Code:
    Echo Remove Teams
    tskill /a msteams
    taskkill /im msteams.exe
    wmic path Win32_Process where ^(name like '%%%%msteams%%%%'^) call Terminate
    pushd "%LOCALAPPDATA%\Microsoft\Teams" && (
        set TeamSetup=
        for /f "tokens=*" %%g in ('dir /a/s/b update.exe') do (if not defined TeamSetup set TeamSetup=%%g)
        popd
        "%TeamSetup%" --uninstall --force-uninstall --system-level
    )
    pushd "%ProgramData%\%USERNAME%\Microsoft\Teams" && (
        set TeamSetup=
        for /f "tokens=*" %%g in ('dir /a/s/b update.exe') do (if not defined TeamSetup set TeamSetup=%%g)
        popd
        "%TeamSetup%" --uninstall --force-uninstall --system-level
    )
    set "Teams_Path="
    set "Teams_Cmd=powershell -noprofile -executionpolicy bypass -command "Get-AppxPackage -Name *MicrosoftTeams* -AllUsers" ^| find /i "PackageFullName""
    set "PackageFullName="
    for /f "tokens=2 delims=:" %%g in ('%teams_CMD%') do set "PackageFullName=%%g"
    if defined PackageFullName set "Teams_Path="%ProgramFiles%\WindowsApps\!PackageFullName:~1!"
    wmic product where (name like "%%team%%") call uninstall /nointeractive
    powershell -noprofile -executionpolicy bypass -command "Get-AppxPackage -Name *Team* -AllUsers | Foreach {Remove-AppxPackage $_.PackageFullName -AllUsers}"
    powershell -noprofile -executionpolicy bypass -command "Get-ProvisionedAppxPackage -Online | Where-Object { $_.PackageName -match 'Team' } | ForEach-Object { Remove-ProvisionedAppxPackage -Online -AllUsers -PackageName $_.PackageName }"
    powershell -noprofile -executionpolicy bypass -command "Get-AppxPackage *Teams* -AllUsers| Remove-AppPackage -AllUsers"
    call :DestroyFolder "%appdata%\Teams"
    call :DestroyFolder "%appdata%\Microsoft\Teams"
    call :DestroyFolder "%LOCALAPPDATA%\Microsoft\Teams"
    call :DestroyFolder "%ProgramData%\%USERNAME%\Microsoft\Teams"
    cmd.exe /c takeown /f "%ProgramData%\Packages\MicrosoftTeams_8wekyb3d8bbwe" /r /d j && icacls "%ProgramData%\Packages\MicrosoftTeams_8wekyb3d8bbwe" /grant:r Administrator:(OI)(CI)F /T
    call :DestroyFolder "%ProgramData%\Packages\MicrosoftTeams_8wekyb3d8bbwe"
    cmd.exe /c takeown /f "%SystemDrive%\Users\All Users\Packages\MicrosoftTeams_8wekyb3d8bbwe" /r /d j && icacls "%SystemDrive%\Users\All Users\Packages\MicrosoftTeams_8wekyb3d8bbwe" /grant:r Administratoren:(OI)(CI)F /T
    call :DestroyFolder "%SystemDrive%\Users\All Users\Packages\MicrosoftTeams_8wekyb3d8bbwe"
    cmd.exe /c takeown /f "%SystemDrive%\Users\All Users\Microsoft\Windows\AppRepository\Packages\MicrosoftTeams_21253.510.996.1465_x64__8wekyb3d8bbwe" /r /d j && icacls "%SystemDrive%\Users\All Users\Microsoft\Windows\AppRepository\Packages\MicrosoftTeams_21253.510.996.1465_x64__8wekyb3d8bbwe" /grant:r Administratoren:(OI)(CI)F /T
    call :DestroyFolder "%SystemDrive%\Users\All Users\Microsoft\Windows\AppRepository\Packages\MicrosoftTeams_21253.510.996.1465_x64__8wekyb3d8bbwe"
    cmd.exe /c takeown /f "%ProgramFiles%\WindowsApps\MicrosoftTeams_21253.510.996.1465_x64__8wekyb3d8bbwe" /r /d j && icacls "%ProgramFiles%\WindowsApps\MicrosoftTeams_21253.510.996.1465_x64__8wekyb3d8bbwe" /grant:r Administratoren:(OI)(CI)F /T
    call :DestroyFolder "%ProgramFiles%\WindowsApps\MicrosoftTeams_21253.510.996.1465_x64__8wekyb3d8bbwe"
    cmd.exe /c takeown /f "%ProgramData%\Microsoft\Windows\AppRepository\Packages\MicrosoftTeams_21253.510.996.1465_x64__8wekyb3d8bbwe" /r /d j && icacls "%ProgramData%\Microsoft\Windows\AppRepository\Packages\MicrosoftTeams_21253.510.996.1465_x64__8wekyb3d8bbwe" /grant:r Administratoren:(OI)(CI)F /T
    call :DestroyFolder "%ProgramData%\Microsoft\Windows\AppRepository\Packages\MicrosoftTeams_21253.510.996.1465_x64__8wekyb3d8bbwe"
    if defined Teams_Path (
        pushd !Teams_Path! && (
            popd
            call :DestryFolder !Teams_Path!
        )
        echo. >!Teams_Path!
        icacls !Teams_Path! /inheritance:r
    )
    reg add "HKLM\SOFTWARE\Policies\Microsoft\Office\16.0\common\officeupdate" /v preventteamsinstall /t REG_DWORD /d 1 /f
    reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Deprovisioned\MicrosoftTeams_8wekyb3d8bbwe" /f
    reg add "HKLM\Software\Policies\Microsoft\Windows\Windows Chat" /v "ChatIcon" /t REG_DWORD /d "3" /f
    reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "TaskbarMn" /t REG_DWORD /d "0" /f
    
    :DestroyFolder
    set targetFolder=%*
    if exist %targetFolder% (
        rd /s /q %targetFolder%
        if exist %targetFolder% (
            for /f "tokens=*" %%g in ('dir /b/s /a-d %targetFolder%') do move /y "%%g" "%temp%"
            rd /s /q %targetFolder%
        )
    )
    goto :eof
    
    
     
  2. inTerActionVRI

    inTerActionVRI MDL Expert

    Sep 23, 2009
    1,651
    3,398
    60
    #21722 inTerActionVRI, Nov 30, 2021
    Last edited: Nov 30, 2021
    A part of the script is calling but is not finding the session or block : DestroyFolder,
    all from
    Code:
    :DestryFolder
    
    to
    Code:
    :DestroyFolder
    
     
  3. roedel

    roedel MDL Junior Member

    Jun 3, 2010
    80
    54
    0
    Yes. You're right
    I've edited my post.

    Thank you
     
  4. inTerActionVRI

    inTerActionVRI MDL Expert

    Sep 23, 2009
    1,651
    3,398
    60
    It has this too to be changed.
     
  5. MIMMO61

    MIMMO61 MDL Senior Member

    Aug 19, 2009
    356
    106
    10
    #21726 MIMMO61, Nov 30, 2021
    Last edited: Nov 30, 2021
    I inserted the script in Runonce mode inside the ISO, made tests on a virtual machine. After a time of time reappears
     
  6. graver.x

    graver.x MDL Senior Member

    Jan 18, 2020
    342
    476
    10
    Does removing the ContentDeliveryManager component from the system help in this case?

    I use IoT Enterprise, + remove ContentDeliveryManager.

    And I never see what this Teams, or other applications present in the Start menu as shortcuts to install them the first time I connect to the internet.
     
  7. 正义羊

    正义羊 MDL Senior Member

    Feb 21, 2016
    257
    149
    10
    OK,I understand it

    我明白了。
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. MIMMO61

    MIMMO61 MDL Senior Member

    Aug 19, 2009
    356
    106
    10
    It has been done in the removal of the apps
    Code:
    Component : ContentDeliveryManager
    
    Removing Package files...
    Modifying Package files...
    Loading Image Registry...
    Modifying Package Registry...
    Unloading Image Registry...
    
    The operation completed successfully.
    
     
  9. MSMG

    MSMG MDL Developer

    Jul 15, 2011
    6,411
    15,487
    210
    Fixed the version info and re-uploaded the Toolkit.
     
  10. Feartamixg

    Feartamixg MDL Addicted

    May 15, 2016
    767
    616
    30
    I see that v11.10 has ToolKitHelper.exe v1.0.5724 with a timestamp of 26/11/2021 at 12:20.

    v12.00 has ToolKitHelper.exe v1.0.5616 with a timestap of 13/11/2021 at 15:29 - which seems like an older version.

    Should we be using the older version in v12.00, or did you forget to put the new version from v11.10 into v12.00?

    I am just verifying before I begin testing over the weekend.
     
  11. plasmah77

    plasmah77 MDL Novice

    Apr 3, 2016
    46
    16
    0
    Hi quick question about the removal process. After removing all that bloat from Windows 10 or 11 does any of it get replaced after you update? Thanks
     
  12. graver.x

    graver.x MDL Senior Member

    Jan 18, 2020
    342
    476
    10
    Yes, starting from v1903 some removed components will be returned after CU installation.
     
  13. graver.x

    graver.x MDL Senior Member

    Jan 18, 2020
    342
    476
    10
    Success to you in all your endeavors!
    I join @Feartamixg in asking: The newest version of Toolkit v12.0 has an older ToolkitHelper (v1.0.5616.0) than was used in Toolkit v11.10 (ToolkitHelper v1.0.5724.0).

    I would also like to be sure that this is due to technical necessity, and is not an accidental mistake.
     
  14. graver.x

    graver.x MDL Senior Member

    Jan 18, 2020
    342
    476
    10
    #21735 graver.x, Dec 3, 2021
    Last edited: Dec 3, 2021
    Update the image to the CU specified in the Changelog for Toolkit v11.10-v12.0 (19044.1387), and add this components to you RemovePkgsList (based on a template: Toolkit\Bin\Lists\ToolkitHelper_Templates\RemovePkgsList_W10_LTSC_2021.txt) for its removing:
    Code:
    TIFFIFilter
    OfflineFiles
    OpenSSH
    RemoteDesktopClient
    RDC
    SimpleTCPIPServices
    TelnetClient
    TFTPClient
    RemoteDesktopServer
    RemoteRegistry
    WorksFolderClient
    ProjFS
    StorageSpaces
    
    #21589 (mydigitallife.net)
     
  15. 正义羊

    正义羊 MDL Senior Member

    Feb 21, 2016
    257
    149
    10
    @MSMG ,
    Sorry for speak same issue again.
    In Toolkit v11.10 & 12.0 lines 1751 & 1860:
    Checking whether the selected Source OS is Windows 10 v1809/v1904/v19H2/v20H1/v20H2/v21H1/v21H2 Client Edition

    It should be:
    Checking whether the selected Source OS is Windows 10 v1809/v1903/v1909/v2004/v20H2/v21H1/v21H2 Client Edition

    No v1904/19H2/20H1, they are v1903/1909/2004

    In Toolkit v11.10 & 12.0
    Code:
    :: Checking whether the HOST OS is Windows 7 and selected Source OS is Windows 10/11
    if "%HostVersion%" equ "6.1" if "%SelectedSourceOS%" neq "w7" if "%SelectedSourceOS%" neq "w81" (
        echo.
        echo.ToolKit cannot service Windows 10/11 Source OS on Windows 7 HOST OS...
        echo.
        echo.ToolKit requires a Windows 8.1/10 HOST OS for servicing Windows 10 Source OS...
        goto :Stop
    )
    It should be:
    Code:
    :: Checking whether the HOST OS is Windows 7 and selected Source OS is Windows 10/11
    if "%HostVersion%" equ "6.1" if "%SelectedSourceOS%" neq "w7" if "%SelectedSourceOS%" neq "w81" (
        echo.
        echo.ToolKit cannot service Windows 10/11 Source OS on Windows 7 HOST OS...
        echo.
        echo.ToolKit requires a Windows 8.1/10 HOST OS for servicing Windows 10/11 Source OS...
        goto :Stop
    )
    In Toolkit v11.10 & 12.0 (Update Dec 3rd)
    Code:
        if "%TargetEdition%" equ "ProfessionalCountrySpecific" (
            set "Flag=ProfessionalCountrySpecific"
            set "Edition=ProfessionalCountrySpecific"
            set "Name=Windows %OSID% Pro CountrySpecific"
            set "Description=Windows %OSID% Pro CountrySpecific"
            set "DisplayName=Windows %OSID% Pro CountrySpecific"
            set "DisplayDescription=Windows %OSID% Pro CountrySpecific"
        )
    it should be :
    Code:
        if "%TargetEdition%" equ "ProfessionalCountrySpecific" (
            set "Flag=ProfessionalCountrySpecific"
            set "Edition=ProfessionalCountrySpecific"
            set "Name=Windows %OSID% Pro China Only"
            set "Description=Windows %OSID% Pro China Only"
            set "DisplayName=Windows %OSID% Pro China Only"
            set "DisplayDescription=Windows %OSID% Pro China Only"
        )
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. MSMG

    MSMG MDL Developer

    Jul 15, 2011
    6,411
    15,487
    210
    Fixed the ToolKitHelper Build version and re-uploaded the Toolkit.
     
  17. MSMG

    MSMG MDL Developer

    Jul 15, 2011
    6,411
    15,487
    210

    Have optimized the remove menu and re-uploaded the Toolkit, do checkout if I have missed anything.
     
  18. 正义羊

    正义羊 MDL Senior Member

    Feb 21, 2016
    257
    149
    10
    OK. I'll check it.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  19. zero cool root

    zero cool root MDL Senior Member

    Jun 17, 2011
    376
    161
    10
    Hi

    @MSMG

    Firstly, sorry my bad English..!!

    It would be possible to change the Default Microsoft Inbox Applications menu to look like the Remove Windows Components menu, in which we can select the applications we would like to install and all the selected ones will be installed at once. Instead of one to one..??