Direct Silent Comodo Client Security (CCS) Scan with All Options

Please refer the below script to, Direct Silent Comodo Client Security (CCS) Scan with All Options which are Full scan, Quick scan, Unrecognised scan.
You have to select the options to perform the following scan options.

  1. Full scan
  2. Quick scan,
  3. Unrecognised scan.
    Please change the scan option in the below procedure, where option =2 which means option = value of scan actions(Full,quick, Unrecognised scan)"
    option =1
    is for( Full scan)
    option =2
    is for (Quick scan,)
    option =3
    is for (Unrecognised scan )

    If the script is initiated means you have to wait until the scan completes, in the mean time if u try executing the script, it will display “The scan is already running in the background, please wait for some time…”
#Enter your scanning option  . select 1 for(Full_Scan), 2 for Quick_scan, 3 for  Unrecognized_Scan '
option = 2
import os
import getpass
import socket
print "USER NAME: "+getpass.getuser()
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(("", 80))
print "IP-ADDRESS : "+(s.getsockname()[0])

scan_type={'1':'Full scan','2':'Quick scan','3':'Unrecognized scan'}

def ecmd(CMD, r=False):
    import ctypes
    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:
    from subprocess import PIPE, Popen
    with disable_file_system_redirection():
        OBJ = Popen(CMD, shell = True, stdout = PIPE, stderr = PIPE)
    out, err = OBJ.communicate()
    if r:
        return ret
        if ret==0:
            return out
            return ret

final= ecmd(r'"C:\Program Files\COMODO\COMODO Internet Security\cfpconfg.exe" --launchSchedule '+dic[str(option)],True)
if final==0:
    print  scan_type[str(option)]+'  has been triggered by  Comodo Client Security successfully'
elif final== -2147024713:
    print 'The scan is already running in the background, please wait for some time...'
    print ' The script failed to trigger '+scan_type[str(option)]+'by Comodo Client Security '


20170609-cis_silentscan.json (2.71 KB)