Remove quick icon for given application from the task bar

Hi Everyone,
Please refer attached script to remove quick icon for given application from the task bar.

Edit Parameter:
app=‘Chrome’.

Note:
Please run the script as a “logged in user”.



import os
users = os.environ["APPDATA"]
app='Chrome'
path= users +r'\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar'
os.chdir(path)
removed=0

for i in os.listdir(path):
    if app in i:
        removed=1
        os.remove(i)
        print ("Application removed from task bar")

if removed==0:
    print("Given application not pinned in the task bar or it might removed already
 Please provide valid application name
")

print("Following applications are still pinned in Task bar
")
applist=os.listdir(path)
for i in range(len(applist)+1):
    print i+1,'.', applist[i].replace('.lnk','')
    if i+1==len(applist):
        break




Sample Outputs:

Script attached in JSON format.

removed.png

removed2.png