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 )
    Note:

    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(("8.8.8.8", 80))
print "IP-ADDRESS : "+(s.getsockname()[0])

dic={'1':'{F140D794-60B6-4F00-9235-D6457AA25B22}','2':'{DBB22600-F6F5-41E4-866D-B11CBC208853}','3':'{2BC1F438-A318-4CCC-A065-86425D4B75E5}'}
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:
                self._revert(self.old_value)
    from subprocess import PIPE, Popen
    with disable_file_system_redirection():
        OBJ = Popen(CMD, shell = True, stdout = PIPE, stderr = PIPE)
    out, err = OBJ.communicate()
    ret=OBJ.returncode
    if r:
        return ret
    else:            
        if ret==0:
            return out
        else:
            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...'
else:
    print ' The script failed to trigger '+scan_type[str(option)]+'by Comodo Client Security '

OUTPUT:

20170609-cis_silentscan.json (2.71 KB)