Removing App Packages

Discussion in 'Windows 10' started by SightUp, Nov 3, 2017.

  1. SightUp

    SightUp MDL Senior Member

    Aug 17, 2010
    255
    12
    10
    PowerShell -Command "Get-appxprovisionedpackage –online | where-object {$_.packagename –like "*windowsalarms*"} | remove-appxprovisionedpackage –online"


    I am trying to get this to work in a .bat file. What am I doing wrong? I am told that it needs to use the Elevated PS? I don't know. I am running it in admin and it's not working. I just get an error. See attached file for the actual .bat file I am running. What's wrong with it?
     

    Attached Files:

  2. jinvidia

    jinvidia MDL Junior Member

    Aug 7, 2016
    89
    11
    0
    Did you change the execution policy ? Run ps as administrator. Then input
    set-executionpolicy remotesigned.
    Now run the script.
     
  3. redxii

    redxii MDL Novice

    Aug 7, 2016
    33
    13
    0
    More quotes around the package name will also work. The command I use:

    powershell "Get-appxprovisionedpackage -online | where-object {$_.packagename -like """*windowsalarms*"""} | remove-appxprovisionedpackage -online"
     
  4. Grywald

    Grywald MDL Novice

    Jun 25, 2014
    14
    1
    0
    #5 Grywald, Nov 4, 2017
    Last edited: Nov 8, 2017
    Code:
    This app is part of Windows and cannot be uninstalled [...]
    To resume and from my point of view, it's might be better (and easier to learn) to replace powershell by dism. Because in the past I had try several times and it has never work fine.
    That's just one advice because it will avoid this kind of errors.
     
  5. flipit

    flipit MDL Novice

    Oct 17, 2010
    11
    1
    0

    I tried to execute these command running admin powershell it did not work.
     
  6. pisthai

    pisthai Imperfect Human

    Jul 29, 2009
    6,877
    2,035
    210
    What Error PowerShell show? Please post Screenshot!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. flipit

    flipit MDL Novice

    Oct 17, 2010
    11
    1
    0

    Hey thanks for the quick response, here is the error which shows for all commands.

    packagename : The term '.packagename' is not recognized as the name of a cmdlet, function, script file, or operable
    program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
    At line:1 char:52
    + ... t-appxprovisionedpackage –online | where-object {.packagename –like ...
    + ~~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (.packagename:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
     
  8. pisthai

    pisthai Imperfect Human

    Jul 29, 2009
    6,877
    2,035
    210
    Why didn't you post a screenshot? It gives more info than a written statement! Thanks.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. TobeBest

    TobeBest MDL Novice

    Sep 9, 2012
    2
    0
    0
    Easy way to remove the windows apps is using Ccleaner.
    anyone know how to remove or block ads from windows apps?
     
  10. °ツ

    °ツ MDL Addicted

    Jun 8, 2014
    638
    747
    30
    #11 °ツ, Nov 10, 2017
    Last edited: Nov 11, 2017
    You should run that as a batch script (.bat file).
    You don't even need to run it as admin, just double click the bat file.
    I used similar code to install some app without using the store.


    Forget what I wrote, it does not work now when I tested in a VM.
    It works for installing appx by using "Add-AppxPackage -Path" but it does not work for removing.
    Sorry, should have tested before posting.
     
  11. Tiger-1

    Tiger-1 MDL Guru

    Oct 18, 2014
    4,125
    4,609
    150
    Hi good job dude :good3: @ your post #003:)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. Nucleus

    Nucleus MDL Guru

    Aug 4, 2009
    2,873
    2,933
    90
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. Tiger-1

    Tiger-1 MDL Guru

    Oct 18, 2014
    4,125
    4,609
    150
    @ Nucleus :eek::rolleyes:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...