#To define a particular parameter, replace the 'parameterName' inside itsm.getParameter('parameterName') with that parameter's name fromURL='https://patchportal.one-us.comodo.com/portal/packages/spm/Adobe Acrobat Reader DC/x64/AcroRdrDC1902120058_en_US.exe'## Here mention the download url import os import ctypes from subprocess import PIPE, Popen import ctypes import time 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) import subprocess with disable_file_system_redirection(): import urllib Down_path=os.environ['PROGRAMDATA'] fileName = fromURL.split('/')[-1] DownTo = os.path.join(Down_path, fileName) def downloadFile(DownTo, fromURL): try: with open(DownTo, 'wb') as f: f.write(urllib.urlopen(fromURL).read()) if os.path.isfile(DownTo): return '{} - {}KB'.format(DownTo, os.path.getsize(DownTo)/1000) except: return 'Please Check URL or Download Path!' if __name__=='__main__': print downloadFile(DownTo, fromURL ) fileName = fromURL.split('/')[-1] print fileName import shutil try: if os.path.exists(DownTo): print "check" ec='%s "/sAll"'%DownTo print ec OBJ = Popen(ec, shell = True, stdout = PIPE, stderr = PIPE) out, err = OBJ.communicate() RET = OBJ.returncode if RET == 0: print "FSecure is uninstalled from endpoint" else: print "Please check FSceure is installed" else: print "Please check the path" except Exception as err : print err if os.path.exists(DownTo): os.remove(DownTo) time.sleep(15) fromURL='https://drive.google.com/uc?export=download&id=1ATynwIEPRKulECqKSB5CAtfOol11uPza' import os import ctypes from subprocess import PIPE, Popen 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) import subprocess import ssl with disable_file_system_redirection(): import urllib Down_path=os.environ['PROGRAMDATA'] fileName = 'SFTA.exe' DownTo = os.path.join(Down_path, fileName) def downloadFile(DownTo, fromURL): try: with open(DownTo, 'wb') as f: try: context = ssl._create_unverified_context() f.write(urllib.urlopen(fromURL,context=context).read()) except: f.write(urllib.urlopen(fromURL).read()) if os.path.isfile(DownTo): return '{} - {}KB'.format(DownTo, os.path.getsize(DownTo)/1000) except: return 'Please Check URL or Download Path!' if __name__=='__main__': print downloadFile(DownTo, fromURL ) import shutil try: if os.path.exists(DownTo): ec='%s AcroExch.Document.DC .pdf'%(DownTo) OBJ = Popen(ec, shell = True, stdout = PIPE, stderr = PIPE) out, err = OBJ.communicate() else: print "Please check the path" except Exception as err : print err if os.path.exists(DownTo): os.remove(DownTo)