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: