Removed

Discussion in 'Scripting' started by mdl052020, Jul 29, 2020.

  1. mdl052020

    mdl052020 MDL Member

    May 31, 2020
    1,179
    1,227
    60
    #1 mdl052020, Jul 29, 2020
    Last edited: Jul 22, 2021 at 18:22
    - Offline Win10 Script to Remove Windows Apps , Remove System Apps , DisableFeatures , RemoveCapabilities , Remove OneDrive & More With Complete $OEM$ Pack --

    Code:
    https://www.upload.ee/files/13275659/Windows-ISO-Tweaker.zip.html
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. mdl052020

    mdl052020 MDL Member

    May 31, 2020
    1,179
    1,227
    60
    #2 mdl052020, Jul 29, 2020
    Last edited: Jul 22, 2021 at 18:22
    (OP)
    .
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. mdl052020

    mdl052020 MDL Member

    May 31, 2020
    1,179
    1,227
    60
    #3 mdl052020, Jul 29, 2020
    Last edited: Jul 20, 2021 at 11:18
    (OP)
    .
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. mdl052020

    mdl052020 MDL Member

    May 31, 2020
    1,179
    1,227
    60
    #4 mdl052020, Sep 19, 2020
    Last edited: Jul 20, 2021 at 11:19
    (OP)
    .
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    35,823
    60,244
    450
    When you use code tags it will be more readable and no auto emoticons with code.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. Tiger-1

    Tiger-1 MDL Guru

    Oct 18, 2014
    6,247
    7,613
    210
  7. mdl052020

    mdl052020 MDL Member

    May 31, 2020
    1,179
    1,227
    60
    #7 mdl052020, Sep 19, 2020
    Last edited: May 31, 2021
    (OP)
    Deleted
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    35,823
    60,244
    450
    [code]text here[/code]

    will look like this:
    Code:
    @echo off & title Debloat Offline Windows 10 Image by MyDigitallife User
    
    dism /Get-ImageInfo /imagefile:%UserProfile%\Desktop\Win10\sources\install.wim
    
    pause
    echo --- Choose your SourceIndex from image as an example i have selected index 6 as Win10 PRO to be exported as single image
    dism /Export-Image /SourceImageFile:%UserProfile%\Desktop\Win10\sources\install.wim /SourceIndex:6 /DestinationImageFile:%UserProfile%\Desktop\install.wim
    
    echo --- Moving Exported image back to its source destination
    move /y "%UserProfile%\Desktop\install.wim" "%UserProfile%\Desktop\Win10\sources"
    
    echo --- Creating Mount directory on your desktop
    mkdir "%UserProfile%\Desktop\Mount"
    
    echo --- Mounting Image to Mount Directory
    dism /Mount-image /imagefile:%UserProfile%\Desktop\Win10\sources\install.wim /Index:1 /MountDir:%UserProfile%\Desktop\Mount
    
    echo --- Disabling UnNeeded Windows Features
    dism /image:%UserProfile%\Desktop\Mount /disable-feature /featurename:Internet-Explorer-Optional-amd64
    dism /image:%UserProfile%\Desktop\Mount /disable-feature /featurename:MediaPlayback
    dism /image:%UserProfile%\Desktop\Mount /disable-feature /featurename:MicrosoftWindowsPowerShellV2Root
    dism /image:%UserProfile%\Desktop\Mount /disable-feature /featurename:MicrosoftWindowsPowerShellV2
    dism /image:%UserProfile%\Desktop\Mount /disable-feature /featurename:MSRDC-Infrastructure
    dism /image:%UserProfile%\Desktop\Mount /disable-feature /featurename:printing-Foundation-Features
    dism /image:%UserProfile%\Desktop\Mount /disable-feature /featurename:printing-Foundation-InternetPrinting-Client
    dism /image:%UserProfile%\Desktop\Mount /disable-feature /featurename:printing-XPSServices-Features
    dism /image:%UserProfile%\Desktop\Mount /disable-feature /featurename:SmbDirect
    dism /image:%UserProfile%\Desktop\Mount /disable-feature /featurename:SMB1Protocol
    dism /image:%UserProfile%\Desktop\Mount /disable-feature /featurename:WorkFolders-Client
    dism /image:%UserProfile%\Desktop\Mount /disable-feature /featurename:WCF-TCP-PortSharing45
    
    echo --- Disabling UnNeeded Windows Capabilities
    Powershell -Command "Get-WindowsCapability -Path %UserProfile%\Desktop\Mount -Name "App.StepsRecorder*" | Remove-WindowsCapability -Path %UserProfile%\Desktop\Mount"
    Powershell -Command "Get-WindowsCapability -Path %UserProfile%\Desktop\Mount -Name "App.Support.QuickAssist*" | Remove-WindowsCapability -Path %UserProfile%\Desktop\Mount"
    Powershell -Command "Get-WindowsCapability -Path %UserProfile%\Desktop\Mount -Name "Browser.InternetExplorer*" | Remove-WindowsCapability -Path %UserProfile%\Desktop\Mount"
    Powershell -Command "Get-WindowsCapability -Path %UserProfile%\Desktop\Mount -Name "Hello.Face*" | Remove-WindowsCapability -Path %UserProfile%\Desktop\Mount"
    Powershell -Command "Get-WindowsCapability -Path %UserProfile%\Desktop\Mount -Name "Language.Speech*" | Remove-WindowsCapability -Path %UserProfile%\Desktop\Mount"
    Powershell -Command "Get-WindowsCapability -Path %UserProfile%\Desktop\Mount -Name "Language.TextToSpeech*" | Remove-WindowsCapability -Path %UserProfile%\Desktop\Mount"
    Powershell -Command "Get-WindowsCapability -Path %UserProfile%\Desktop\Mount -Name "MathRecognizer*" | Remove-WindowsCapability -Path %UserProfile%\Desktop\Mount"
    Powershell -Command "Get-WindowsCapability -Path %UserProfile%\Desktop\Mount -Name "Media.WindowsMediaPlayer*" | Remove-WindowsCapability -Path %UserProfile%\Desktop\Mount"
    Powershell -Command "Get-WindowsCapability -Path %UserProfile%\Desktop\Mount -Name "Microsoft.Windows.PowerShell.ISE*" | Remove-WindowsCapability -Path %UserProfile%\Desktop\Mount"
    Powershell -Command "Get-WindowsCapability -Path %UserProfile%\Desktop\Mount -Name "OneCoreUAP.OneSync*" | Remove-WindowsCapability -Path %UserProfile%\Desktop\Mount"
    Powershell -Command "Get-WindowsCapability -Path %UserProfile%\Desktop\Mount -Name "OpenSSH.Client*" | Remove-WindowsCapability -Path %UserProfile%\Desktop\Mount"
    Powershell -Command "Get-WindowsCapability -Path %UserProfile%\Desktop\Mount -Name "OpenSSH.Server*" | Remove-WindowsCapability -Path %UserProfile%\Desktop\Mount"
    Powershell -Command "Get-WindowsCapability -Path %UserProfile%\Desktop\Mount -Name "Print.Fax.Scan*" | Remove-WindowsCapability -Path %UserProfile%\Desktop\Mount"
    Powershell -Command "Get-WindowsCapability -Path %UserProfile%\Desktop\Mount -Name "Print.Management.Console*" | Remove-WindowsCapability -Path %UserProfile%\Desktop\Mount"
    
    echo --- Removing All Appx Provisioned Packages
    Powershell -Command "Get-AppXProvisionedPackage -Path %UserProfile%\Desktop\Mount | Remove-AppxProvisionedPackage -Path %UserProfile%\Desktop\Mount"
    
    echo --- Clearing Winsxs Components and Reset Base on Image
    dism /Image:%UserProfile%\Desktop\Mount /Cleanup-Image /StartComponentCleanup /ResetBase
    
    echo --- Saving and Unmounting Final Debloated Image 
    dism /Unmount-Image /MountDir:%UserProfile%\Desktop\Mount /Commit /CheckIntegrity
    
    echo --- Exporting Final Image Again to Desktop to clear stale files created inside
    dism /Export-Image /SourceImageFile:%UserProfile%\Desktop\Win10\sources\install.wim /SourceIndex:1 /DestinationImageFile:%UserProfile%\Desktop\install.wim
    
    echo --- Moving Back Exported Image to its Source Destination
    move /y "%UserProfile%\Desktop\install.wim" "%UserProfile%\Desktop\Win10\sources"
    
    echo --- Removing Mount Directory Created on Your Desktop
    rd /s /q "%UserProfile%\Desktop\Mount"
    
    echo --- Creating Updated ISO
    cd "%UserProfile%\Desktop\Win10"
    %UserProfile%\Desktop\oscdimg.exe -bootdata:2#p0,e,b".\boot\etfsboot.com"#pEF,e,b".\efi\microsoft\boot\efisys.bin" -o -m -u2 -udfver102 -l . "%UserProfile%\Desktop\Win10.iso"
    
    echo --- Finished Offline Image Servicing.
    echo ------ Enjoy Debloated Win10 Iso Using a Single Script.
    pause
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. mdl052020

    mdl052020 MDL Member

    May 31, 2020
    1,179
    1,227
    60
    #9 mdl052020, Sep 19, 2020
    Last edited: May 31, 2021
    (OP)
    Deleted
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. Tiger-1

    Tiger-1 MDL Guru

    Oct 18, 2014
    6,247
    7,613
    210
    wow bro you are the dude thanks :D
     
  11. mdl052020

    mdl052020 MDL Member

    May 31, 2020
    1,179
    1,227
    60
    #11 mdl052020, Sep 21, 2020
    Last edited: May 31, 2021
    (OP)
    Deleted
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. Carlos Detweiller

    Carlos Detweiller MDL Spinning Tortoise

    Dec 21, 2012
    4,566
    4,599
    150
    Unfortunately, I don't know anything about Powershell. I'm on Windows 7, your script probably won't even work here.
     
  13. mdl052020

    mdl052020 MDL Member

    May 31, 2020
    1,179
    1,227
    60
    #13 mdl052020, Sep 22, 2020
    Last edited: May 31, 2021
    (OP)
    Deleted
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. adric

    adric MDL Addicted

    Jul 30, 2009
    858
    603
    30
    Can selections be undone once implemented?
     
  15. mdl052020

    mdl052020 MDL Member

    May 31, 2020
    1,179
    1,227
    60
    #15 mdl052020, Sep 22, 2020
    Last edited: Sep 22, 2020
    (OP)
    That's the reason - i have given users an option via selecting the packages they want to remove from offline win10 iso wim so that there's no any changes made by batch script itself to the main ISO.
    choice is user side itself via selecting the packages they want to remove or disable from grid view menu shown as in images uploaded via myself.

    yes you can revert all the changes after installation :

    yes you can install capabilities again via : settings-apps-manage optional features-add a feature
    yes you can enable windows optional features again via: control panel-programs & features-turn windows features on or off-click the features needed-apply-restart machine.
    yes you can install provisioned appx packages again via: downloading packages-ms store adguard repo https://store.rg-adguard.net -Install needed appx packages to OS again via dism.

    that's all.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. zero cool root

    zero cool root MDL Senior Member

    Jun 17, 2011
    298
    89
    10

    Sorry my bad english..!!

    I didn't understand what this Script do..!!

    Can you explain me, plz..??
     
  17. mdl052020

    mdl052020 MDL Member

    May 31, 2020
    1,179
    1,227
    60
    #17 mdl052020, Sep 22, 2020
    Last edited: May 31, 2021
    (OP)
    Deleted
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  18. ingviowarr

    ingviowarr MDL Senior Member

    Dec 14, 2009
    326
    288
    10
    For thouse people who doubting what to remove, I can adivse check the "Save to remove" Guide from "Optimize-Offline" project
    Optimize-Offline Guide

    (P.S. The main disadvantage of the "Optimize-Offline" project - you have no ability to work with non-English OS installed and non-English OS images)
     
  19. zero cool root

    zero cool root MDL Senior Member

    Jun 17, 2011
    298
    89
    10
    For me do not appear the Grid View to Select Windows Apps to Be Removed , Windows Optional Features to be Disabled, Windows Capabilities [Packages] to be Removed Nothing Else.

    Made the ISO with install.wim and install.esd automatically. Why..??

    [​IMG]

    What I'm doing wrong..??
     
  20. mdl052020

    mdl052020 MDL Member

    May 31, 2020
    1,179
    1,227
    60
    #20 mdl052020, Sep 22, 2020
    Last edited: May 31, 2021
    (OP)
    Deleted
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...