[no solution]Is there a way to remove multi packages at once ?

Discussion in 'Windows 10' started by LiteOS, Mar 5, 2016.

  1. LiteOS

    LiteOS MDL Expert

    Mar 7, 2014
    1,368
    516
    60
    #1 LiteOS, Mar 5, 2016
    Last edited: Mar 6, 2016
  2. xinso

    xinso MDL Guru

    Mar 5, 2009
    3,933
    5,282
    120
    #2 xinso, Mar 5, 2016
    Last edited by a moderator: Apr 20, 2017
    This is interesting. Could you please elaborate?

    Like this?

    List.txt
    Code:
    Microsoft-Windows-DirectoryServices-ADAM-Client-Package~31bf3856ad364e35~amd64~~10.0.14279.1000
    Microsoft-Windows-Client-EmbeddedExp-Package~31bf3856ad364e35~amd64~~10.0.14279.1000
    Microsoft-Windows-Client-ShellLauncher-Package~31bf3856ad364e35~amd64~~10.0.14279.1000
    Microsoft-Windows-MultiPoint-Connector-Package~31bf3856ad364e35~amd64~~10.0.14279.1000
    Microsoft-Windows-IIS-WebServer-Package~31bf3856ad364e35~amd64~~10.0.14279.1000
    Microsoft-OneCore-WebService-Package~31bf3856ad364e35~amd64~~10.0.14279.1000
    Microsoft-OneCore-WebService-WOW64-Package~31bf3856ad364e35~amd64~~10.0.14279.1000
    Microsoft-Windows-RAS-Package~31bf3856ad364e35~amd64~~10.0.14279.1000
    Microsoft-Windows-RasCMAK-Package~31bf3856ad364e35~amd64~~10.0.14279.1000
    Microsoft-Windows-RasRip-Package~31bf3856ad364e35~amd64~~10.0.14279.1000
    Microsoft-Windows-Telnet-Client-Package~31bf3856ad364e35~amd64~~10.0.14279.1000
    Microsoft-Windows-TFTP-Client-Package~31bf3856ad364e35~amd64~~10.0.14279.1000
    Microsoft-Windows-WinOcr-Package~31bf3856ad364e35~amd64~~10.0.14279.1000
    Media-Ocr-Package~31bf3856ad364e35~amd64~~10.0.14279.1000
    Media-Ocr-WOW64-Package~31bf3856ad364e35~amd64~~10.0.14279.1000
    Microsoft-Windows-LanguageFeatures-OCR-zh-tw-Package~31bf3856ad364e35~amd64~~10.0.14279.1000
    Microsoft-Windows-NFS-ClientSKU-Package~31bf3856ad364e35~amd64~~10.0.14279.1000
    Microsoft-Windows-Identity-Foundation-Package~31bf3856ad364e35~amd64~~10.0.14279.1000
    Microsoft-Windows-DirectPlay-OC-package~31bf3856ad364e35~amd64~~10.0.14279.1000
    Microsoft-Windows-DataCenterBridging-Package~31bf3856ad364e35~amd64~~10.0.14279.1000
    Microsoft-Windows-SNMP-Package~31bf3856ad364e35~amd64~~10.0.14279.1000
    Microsoft-Windows-SimpleTCP-Package~31bf3856ad364e35~amd64~~10.0.14279.1000
    Remove-Package-Online.cmd
    Code:
    @echo off
    pushd "%~dp0"
    
    for /f %%i in ('findstr /i . List.txt 2^>nul') do dism /NoRestart /Online /Remove-package:%SystemRoot%\servicing\Packages\%%i.mum
    
    pause
    Or
    Code:
    @echo off
    pushd "%~dp0"
    
    for /f %%i in ('findstr /i . List.txt 2^>nul') do dism /NoRestart /Online /Remove-package /Packagename:%%i
    
    pause
     
  3. LiteOS

    LiteOS MDL Expert

    Mar 7, 2014
    1,368
    516
    60
    #3 LiteOS, Mar 5, 2016
    Last edited: Mar 5, 2016
    (OP)
    I mean like multi thread
    all at once

    when removing packages online its make pending.xml file to remove the packages after restart
    which doing it all at once from one dism process...

    from image its remove the packages one by one and create new dism process every time and losing time

    maybe with start /wait or using sleep and run all at once mb it will save more time
     
  4. xinso

    xinso MDL Guru

    Mar 5, 2009
    3,933
    5,282
    120
    #4 xinso, Mar 5, 2016
    Last edited: Mar 5, 2016
    Then it suggests Multi-Threads at a time?

    Unlike DISM, NTLite removes packages BEFORE a restart, I reckon. But it still takes long time...
     
  5. LiteOS

    LiteOS MDL Expert

    Mar 7, 2014
    1,368
    516
    60
    Multi-Process but its too demanding, i guess its will be ok for ramdisk


    even with SSD NTLite takes time ?
     
  6. xinso

    xinso MDL Guru

    Mar 5, 2009
    3,933
    5,282
    120
    #6 xinso, Mar 5, 2016
    Last edited: Mar 5, 2016
    Yes. I am a legal NTLite user.

    OK. Ramdisk. I have 24 GB Ram.

    But how to run in multi-threads? start /wait? I do not think so.
     
  7. LiteOS

    LiteOS MDL Expert

    Mar 7, 2014
    1,368
    516
    60
    #7 LiteOS, Mar 5, 2016
    Last edited: Mar 5, 2016
    (OP)
  8. xinso

    xinso MDL Guru

    Mar 5, 2009
    3,933
    5,282
    120
    #8 xinso, Mar 5, 2016
    Last edited: Mar 5, 2016
    Hey, it is impossible with DISM. Because it would not allow multi-threads. Am I wrong?

    That way will remove all sub-packages too, no?
     
  9. LiteOS

    LiteOS MDL Expert

    Mar 7, 2014
    1,368
    516
    60
    #9 LiteOS, Mar 5, 2016
    Last edited: Mar 5, 2016
    (OP)
    Yes that why im asking mb there a way to use dismhost instant of dism


    cant make external powershell.exe process from powershell_ise
     
  10. xinso

    xinso MDL Guru

    Mar 5, 2009
    3,933
    5,282
    120
    #10 xinso, Mar 5, 2016
    Last edited: Mar 5, 2016
    I am running MSMG Toolkit in Primo Ramdisk Server Edition with 18 GB. It is fast...

    I can realize why MSMG Toolkit takes long time in removing multiple packages.

    For each package, it

    1. mounts registry

    2. takes ownership

    3. sets values, and removes owners

    4. unmounts registry

    But I dare not feedback to him. I am afraid that it might be offensive.

    Yeah, Ramdisk is far quicker...
     
  11. LiteOS

    LiteOS MDL Expert

    Mar 7, 2014
    1,368
    516
    60
    #11 LiteOS, Mar 5, 2016
    Last edited: Mar 5, 2016
    (OP)
    i run powershell_ise as trustedinstaller it reduce the steps

    mb he doesnt use
    /ScratchDir:. parameter?
     
  12. xinso

    xinso MDL Guru

    Mar 5, 2009
    3,933
    5,282
    120
    #12 xinso, Mar 5, 2016
    Last edited: Mar 5, 2016
  13. LiteOS

    LiteOS MDL Expert

    Mar 7, 2014
    1,368
    516
    60
    #13 LiteOS, Mar 5, 2016
    Last edited: Mar 5, 2016
    (OP)
    Yes the another reason i use it to save ssd from too much wear ;)
     
  14. xinso

    xinso MDL Guru

    Mar 5, 2009
    3,933
    5,282
    120
    #14 xinso, Mar 5, 2016
    Last edited by a moderator: Apr 20, 2017
    Yes, he does.

    Code:
    set DismScratch=%~dp0Temp\DISM
    
    set "DismFormat=/English /ScratchDir:%DismScratch% /LogPath:%~dp0Logs\Dism.txt /LogLevel:3 /NoRestart"
     
  15. LiteOS

    LiteOS MDL Expert

    Mar 7, 2014
    1,368
    516
    60
    #15 LiteOS, Mar 5, 2016
    Last edited by a moderator: Apr 20, 2017
    (OP)
    this should work
    Code:
    $s |  foreach {  "start dism /ScratchDir:. /image:temp /Remove-Package /PackageName:" + $PSItem | out-file -Append test2.bat } 
    

    nope not working :\ i guess the error while opening lots of dism at once saying it cant be serviced all at once
     
  16. xinso

    xinso MDL Guru

    Mar 5, 2009
    3,933
    5,282
    120
    #16 xinso, Mar 5, 2016
    Last edited: Mar 5, 2016
    lite8, how do you use dismhost? Does it decrypt an ESD?

    Oh, I will have a go of it.

    Sorry, I can not understand the usage.
     
  17. LiteOS

    LiteOS MDL Expert

    Mar 7, 2014
    1,368
    516
    60
    its internal exe duno if its can be used as dism at normal cmdline
     
  18. xinso

    xinso MDL Guru

    Mar 5, 2009
    3,933
    5,282
    120
    #18 xinso, Mar 5, 2016
    Last edited: Mar 5, 2016
    dism calls dismhost.

    lite8,
    wimlib-imagex uses 8 threads on my PC.
     
  19. LiteOS

    LiteOS MDL Expert

    Mar 7, 2014
    1,368
    516
    60
    #19 LiteOS, Mar 5, 2016
    Last edited: Mar 5, 2016
    (OP)
    on ramdisk ? mine too
     
  20. xinso

    xinso MDL Guru

    Mar 5, 2009
    3,933
    5,282
    120
    I meant is wimlib-imagex able to remove a package?