import os
import ctypes
reg_path=[r'HKLM\Software\Wow6432Node\MyDLP']
reg_key=['endpoint_uninstall_password']

def reg_rv(reg_path,reg_key):
    cmd='REG DELETE "%s" /v %s /f'%(reg_path,reg_key)
    print cmd
    #return os.popen(cmd).read()

class disable_file_system_redirection:
    _disable = ctypes.windll.kernel32.Wow64DisableWow64FsRedirection
    _revert = ctypes.windll.kernel32.Wow64RevertWow64FsRedirection
    def __enter__(self):
        self.old_value = ctypes.c_long()
        self.success = self._disable(ctypes.byref(self.old_value))
    def __exit__(self, type, value, traceback):
        if self.success:
            self._revert(self.old_value)
with disable_file_system_redirection():
    try:#Disable password
        for i in range(len(reg_path)):
            reg_rv(reg_path[i],reg_key[0])
        #Uninstall
        print os.popen('wmic /INTERACTIVE:OFF product where name="Comodo Data Protection" call uninstall').read()
    except Exception as E:
        print E
            
        