import os
import subprocess
import getpass as gt

black_list = ["spotify","Disney","Facebook","Messenger","Instagram","Tiktok"]#Add the apps which you want to uninstall from your device
def ecmd(app):
	user = gt.getuser()
	print("Uninstalling "+app+".........")
	cmd = subprocess.Popen(["powershell","Get-AppxPackage *"+app+"* | Remove-AppxPackage "],shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
	result,error=cmd.communicate()
	if error:
		print error
	else:
		pass 

	if os.path.exists(os.path.join('C:\\','Users',user,'AppData','Roaming',app)):
		command = '"'+os.path.join('C:\\','Users',user,'AppData','Roaming',app,app+'.exe')+'"'+" /UNINSTALL /SILENT" 
		cmd_1 = subprocess.Popen(command,shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
		result_1,error_1=cmd_1.communicate()
		if error_1:
			print error_1
		else:
			pass
	else:
		pass 
	print (app+" Uninstalled Successfully.")
for i in black_list:
	ecmd(i.strip())
