Clean specific folder for all users

Please use the script to clean specific folder for all users

## get all folders form C:\\Users
from subprocess import Popen, PIPE
import os
yP = 'C:\\Users\\Prime\\Downloads'
cL = yP.split(os.sep)
tempL = []
if os.path.isdir(yP):    
    if cL[1].lower() == 'users':
        rP = os.sep.join(cL[:2])
        lP = os.sep.join(cL[3:])
        aP = os.listdir(rP)
        for i in aP:
            fiP = rP+os.sep+i+os.sep+lP
            if os.path.isdir(fiP):
                tempL.append(fiP)
            else:
                pass
    else:
        print '1: It is not an User Directory'
elif os.path.isfile(yP):
    print '2: It is not an Directory'
else:
    print '3: It is not an Path'

temp = []
for tf in tempL:
    try:
        os.popen('FOR /D %p IN ("'+tf+'\\*.*") DO rd "%p" /s /q')
        os.popen('del "'+tf+'\\*" /F /Q')
        temp.append(tf)
    except:
        pass

if temp != []:
    print 'Following folders are cleaned
'
    for i in temp:
        print i

Sample Output:

Clean specific folder for all users.PNG

Is it possible to use OS variables? Users folders may differ at different OS or different custom settings. Be more useful set this folders with mask and with variables.

For example: %UserFolder/*TemporaryInternetFiles/

Hi @Sergey

the procedure to clean temporary internet files using System Variable is in progress in another side, we let you know once we complete the procedure.