locked
Cannot Remove Windows 10 apps during task sequence RRS feed

  • Question

  • I'm using this script from Michael Niehaus

    https://blogs.technet.microsoft.com/mniehaus/2015/11/11/removing-windows-10-in-box-apps-during-a-task-sequence/

    Anyone using it with MDT?

    I'm removing Windows 10 apps during post install phase by running the powershell script. It works without any problems if I use install.wim from original Windows 10 1607 media, but if I try to use my own reference image that is build by MDT automatically it wont work. Apps cannot be removed anymore when using custom image and running the script only gives error that it cannot find the apps. I have not removed any apps during the reference image creation. It's odd that the script lists those apps but when it's trying to remove them I get only errors.

    I get this in the error log:

    **********************
    INFO: Apps selected for removal: Microsoft.3DBuilder Microsoft.Appconnector Microsoft.BingFinance Microsoft.BingNews Microsoft.BingSports Microsoft.BingWeather Microsoft.CommsPhone Microsoft.ConnectivityStore Microsoft.Getstarted Microsoft.MicrosoftOfficeHub Microsoft.MicrosoftSolitaireCollection Microsoft.Office.Sway Microsoft.OneConnect Microsoft.SkypeApp Microsoft.WindowsCamera Microsoft.WindowsFeedbackHub Microsoft.WindowsMaps Microsoft.WindowsPhone Microsoft.XboxApp Microsoft.XboxIdentityProvider Microsoft.ZuneMusic Microsoft.ZuneVideo.Count
    INFO: Removing provisioned package Microsoft.3DBuilder
    PS>TerminatingError(Remove-AppxProvisionedPackage): "The system cannot find the file specified.
    "
    Remove-AppxProvisionedPackage : The system cannot find the file specified.

    At \\LAB-MDT01\MDTProd$\Scripts\Custom\RemoveApps.ps1:171 char:14
    + ...        $a = Remove-AppxProvisionedPackage -Path $script:OfflinePath - ...
    +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
        + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

    Monday, March 13, 2017 10:42 PM

All replies

  • Same exact issue here.  I see this was posted a month ago but hoping to resurrect the thread and get an answer.  Unfortunately I have nothing to add as I'm encountering the exact same situation and any variation of code that I've tried results in the file cannot find the file specified even though the list is generated from the same mounted wim.

    KMitchelson

    Wednesday, April 19, 2017 8:33 PM
  • Hi, 

    Can you confirm that you can run the script manually on a freshly deployed image 

    Thursday, April 20, 2017 2:08 AM
  • Yes and no, it's the same script we used with our Pro images and it worked fine.  We switched to Enterprise so I had to make new images and I ran through the same TS in SCCM that we always do with all the customization that we do in it as before including running the powershell script to remove the bloatware and everything comes out perfect, same as before, except the Win10 bloatware is removed but leaves broken ugly shortcuts behind which didnt happen last time.  So now I'm on the quest of removing these apps and shortcuts.  If I mount the image and try to remove the app packages I get the error that they are not found even though I use the package names generated by running Get-AppXProvisionedPackage against the mounted image.  If I run the script during imaging or manually after the image is applied, the powershell script removes the apps but leaves the following screenshot behind.  This screenshot only shows 3 apps but if I remove all 20 or so apps then I'll have 20 of these shortcuts.  Which, by the way, are not found in programdata\ms\windows\start menu to just delete of course.  That'd be too easy.  I don't know where this "Other" category it creates lives to remove it which is another way to tackle this..  


    KMitchelson

    Thursday, April 20, 2017 3:04 PM
  • Hey, 

    Can you confirm what version of enterprise you are running along with the script you are using so i can test it out. All the tests i have run are working successfully on both online and an offline image


    Thursday, April 20, 2017 10:08 PM
  • I couldn't get this to work. I can list all the apps succesfully with command Get-AppxProvisionedPackage -Path C:\ while in winpe. 

    But when I try to remove any of the apps this is all i get:

     Remove-AppxProvisionedPackage : The system cannot find the file specified.

    This error seems to be happening only if I use custom reference image. Custom reference image is created with MDT and only contains latest updates and .net 3.5. No other modifications. Tested with W10 1607 and 1703 Enterprise. Using vanilla install.wim there are no errors.




    • Edited by DamonWH Monday, June 19, 2017 7:25 PM
    • Proposed as answer by Markus Glanzmann Monday, October 30, 2017 8:05 AM
    Monday, June 19, 2017 7:24 PM
  • I couldn't get this to work. I can list all the apps succesfully with command Get-AppxProvisionedPackage -Path C:\ while in winpe. 

    But when I try to remove any of the apps this is all i get:

     Remove-AppxProvisionedPackage : The system cannot find the file specified.

    This error seems to be happening only if I use custom reference image. Custom reference image is created with MDT and only contains latest updates and .net 3.5. No other modifications. Tested with W10 1607 and 1703 Enterprise. Using vanilla install.wim there are no errors.




    I am facing the same exact issue here, tried everything, tried DISM, tried powershell, I tried running these tools on different versions of Windows 10 (LTSB and 1603), were you ever able to get around this?
    Wednesday, August 16, 2017 8:22 PM