2

I know that Windows app (even the bloatware ones) can be removed through PowerShell, but I would like to achieve the same goal through the command-line processor. I used this guide that I found on How-To Geek to remove the apps I didn't want when I first used Windows, now I would like to make a batch script that automates the process. I already have my script set to delete all associated files and folders I want it to remove, but I can't figure out how to "translate" the PowerShell commands to do the same in cmd.

Here is the closest thing I have to completley removing an app with cmd / batch:

Get-AppxPackage *%APPNAME%* | Remove-AppxPackage
::This is the original PowerShell command that needs to be translated.

rmdir "%FOLDEREXAMPLE%" /s /q
del "%FILEEXAMPLE%" /s /q
Mr. Mendelli
  • 1,468

1 Answers1

3

To remove APPX packages, Remove-AppxPackage is the best and only one reliable command. Another way is to remove/delete the installed files of that app. Remember this procedure does not (and never will) truly uninstall that APPX package.

At first, find folders containing the APPX name (e.g. for "Weather" it will be "Microsoft.BingWeather") in the following directories:

C:\Program Files\WindowsApps\
C:\Users\<user_name>\AppData\Local\Packages\
C:\Windows\InfusedApps\Applications\
C:\Windows\InfusedApps\Packages\

Then make a batch file with the following commands and run it as administrator. Then enter the folders full path containing the appx name. Be cautious when you enter folder path, it should have the Appx name at last.

@echo off
set /p X=Enter Directory path: 
takeown /F %%X /R /D Y
icacls %%X /grant Everyone:F /T
rd /S /Q %%X
pause

Further reading:

Biswapriyo
  • 11,584