#To define a particular parameter, replace the 'parameterName' inside itsm.getParameter('parameterName') with that parameter's name
import os
import shutil

if 'PROGRAMFILES(X86)' in os.environ.keys():
    path= os.path.join(os.environ['PROGRAMFILES(X86)'], 'COMODO\RMM Agent Service\logs')
        
else:
    path= os.path.join(os.environ['PROGRAMFILES'], 'COMODO\RMM Agent Service\logs')

for f in os.listdir(path):
    fpath=os.path.join(path,f)
    try:
        if os.path.isfile(fpath):
            os.remove(fpath);
        if os.path.isdir(fpath):
            shutil.rmtree(fpath)
    except:
        pass
