Updating .bat File, Removing Default Apps

Page 1 of 3 123 LastLast

  1. Posts : 194
    Windows 10
       #1

    Updating .bat File, Removing Default Apps


    I haven't reinstalled Windows 10 or updated it in about a year. When I did, there were several new apps that are completely junk. I have a .bat file that I use to clean stuff up but it's a little outdated and I had to go into the Start menu and uninstall a few apps by hand.

    Here is what I got.

    @rem Remove Apps

    PowerShell -Command "Get-appxpackage -allusers *3dbuilder* | Remove-AppxPackage"
    PowerShell -Command "Get-appxpackage -allusers *windowsalarms* | Remove-AppxPackage"
    PowerShell -Command "Get-appxpackage -allusers *Appconnector* | Remove-AppxPackage"
    PowerShell -Command "Get-appxpackage -allusers *windowscalculator* | Remove-AppxPackage"
    PowerShell -Command "Get-appxpackage -allusers *windowscommunicationsapps* | Remove-AppxPackage"
    PowerShell -Command "Get-appxpackage -allusers *windowscamera* | Remove-AppxPackage"
    PowerShell -Command "Get-appxpackage -allusers *CandyCrushSaga* | Remove-AppxPackage"
    PowerShell -Command "Get-appxpackage -allusers *CandyCrushSodaSaga* | Remove-AppxPackage"
    PowerShell -Command "Get-appxpackage -allusers *officehub* | Remove-AppxPackage"
    PowerShell -Command "Get-appxpackage -allusers *skypeapp* | Remove-AppxPackage"
    PowerShell -Command "Get-appxpackage -allusers *getstarted* | Remove-AppxPackage"
    PowerShell -Command "Get-appxpackage -allusers *zunemusic* | Remove-AppxPackage"
    PowerShell -Command "Get-appxpackage -allusers *windowsmaps* | Remove-AppxPackage"
    PowerShell -Command "Get-appxpackage -allusers *Messaging* | Remove-AppxPackage"
    PowerShell -Command "Get-appxpackage -allusers *solitairecollection* | Remove-AppxPackage"
    PowerShell -Command "Get-appxpackage -allusers *bingfinance* | Remove-AppxPackage"
    PowerShell -Command "Get-appxpackage -allusers *zunevideo* | Remove-AppxPackage"
    PowerShell -Command "Get-appxpackage -allusers *bingnews* | Remove-AppxPackage"
    PowerShell -Command "Get-appxpackage -allusers *onenote* | Remove-AppxPackage"
    PowerShell -Command "Get-appxpackage -allusers *CommsPhone* | Remove-AppxPackage"
    PowerShell -Command "Get-appxpackage -allusers *windowsphone* | Remove-AppxPackage"
    PowerShell -Command "Get-appxpackage -allusers *photos* | Remove-AppxPackage"
    PowerShell -Command "Get-appxpackage -allusers *WindowsScan* | Remove-AppxPackage"
    PowerShell -Command "Get-appxpackage -allusers *bingsports* | Remove-AppxPackage"
    PowerShell -Command "Get-appxpackage -allusers *windowsstore* | Remove-AppxPackage"
    PowerShell -Command "Get-appxpackage -allusers *Office.Sway* | Remove-AppxPackage"
    PowerShell -Command "Get-appxpackage -allusers *Twitter* | Remove-AppxPackage"
    PowerShell -Command "Get-appxpackage -allusers *soundrecorder* | Remove-AppxPackage"
    PowerShell -Command "Get-appxpackage -allusers *bingweather* | Remove-AppxPackage"
    PowerShell -Command "Get-appxpackage -allusers *xboxapp* | Remove-AppxPackage"
    PowerShell -Command "Get-appxpackage -allusers *XboxOneSmartGlass* | Remove-AppxPackage"
    I was hoping we could add a few things such as Connect, Get Help, Paint 3D, Sticky Notes, etc. Does anyone have an updated .bat file they can hook me up with?
      My Computer


  2. Posts : 30,178
    Windows 11 Pro x64 Version 23H2
       #2

    Hi SightUp.

    Don't have a bat file but step 4 in Option 2 will give you complete list and you can mod yours.

    Uninstall Apps in Windows 10


    Ken
      My Computer


  3. Posts : 194
    Windows 10
    Thread Starter
       #3

    Awesome. Two questions.

    First, does "@rem Remove Apps" need to be on top? Or was that something extra that was added when I downloaded the original .bat?

    Second, in the guide, it says "(To only remove XXX app from new accounts created afterwards)" Does this mean that it removes the package folder so it would actually end up saving space?
      My Computer


  4. Posts : 31,630
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #4

    SightUp said:
    does "@rem Remove Apps" need to be on top? Or was that something extra that was added when I downloaded the original .bat?
    By default, commands in a .bat file are echoed to the screen as they are executed. The @ sign in a .bat file says 'don't echo the command on this line'. The REM command is a 'remark' (all text that follows is a comment and not an executable command line). That line is therefore not shown on screen when you run the .bat and is just there to tell you what the purpose of the .bat file is.
      My Computers


  5. Posts : 194
    Windows 10
    Thread Starter
       #5

    Bree said:
    By default, commands in a .bat file are echoed to the screen as they are executed. The @ sign in a .bat file says 'don't echo the command on this line'. The REM command is a 'remark' (all text that follows is a comment and not an executable command line). That line is therefore not shown on screen when you run the .bat and is just there to tell you what the purpose of the .bat file is.
    So it's OK to delete it then?
      My Computer


  6. Posts : 31,630
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #6

    SightUp said:
    So it's OK to delete it then?
    Yes. It does nothing.

    REM lines are useful though, you could add some of your own to say the date when you wrote the file, the version of windows it applies to, give it a revision number, or anything else you like to remind yourself of in the future.
      My Computers


  7. Posts : 194
    Windows 10
    Thread Starter
       #7

    Awesome. So I just need an answer to question number two!
      My Computer


  8. Posts : 31,630
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #8

    SightUp said:
    Second, in the guide, it says "(To only remove XXX app from new accounts created afterwards)" Does this mean that it removes the package folder so it would actually end up saving space?
    You are asking about Option Three in the tutorial Uninstall Apps in Windows 10 ?

    For each app the first line of code uninstalls the app for current users. The second line where it says...
    (To only remove XXX app from new accounts created afterwards)
    ...includes a 'remove-appxprovisionedpackage' command which will indeed remove the install package and gain some space (not a lot, apps are not generally very large).
      My Computers


  9. Posts : 194
    Windows 10
    Thread Starter
       #9

    At line:1 char:67
    + ... ovisionedpackage ûonline | where-object {$_.packagename ûlike *solita ...
    + ~~~~~
    Unexpected token 'ûlike' in expression or statement.
    + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : UnexpectedToken
    I am getting that error due to the following command.

    PowerShell -Command "Get-appxprovisionedpackage –online | where-object {$_.packagename –like "*solitairecollection*"} | remove-appxprovisionedpackage –online"
    Can this not be done via .bat file?
      My Computer


  10. Posts : 31,630
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #10

    SightUp said:
    I am getting that error due to the following command.
    Can this not be done via .bat file?
    The tutorial says to run the commands in an elevated powershell. You'll probably need to run the .bat as an administrator, say from within an elevated command prompt.
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 17:11.
Find Us




Windows 10 Forums