#To define a particular parameter, replace the 'parameterName' inside itsm.getParameter('parameterName') with that parameter's name
import _winreg
import getpass
Key= r"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\UserChoice" ## Here give the registry Key path. STRING
Sub_Key= "ProgId" ## Here give the sub Key of the registry. STRING
Field= _winreg.REG_SZ ##Here give the field of it
value = 'AcroExch.Document.DC' ##Mention the value 

import os
from _winreg import *
try:
    Key=r"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\UserChoice"    
    if not os.path.exists(Key):
        key = _winreg.CreateKey(HKEY_CURRENT_USER,Key)
    Registrykey= OpenKey(HKEY_CURRENT_USER,Key, 0,KEY_WRITE)

    _winreg.SetValueEx(Registrykey,Sub_Key,0,Field,value)
    CloseKey(Registrykey)
    print "Success"
except WindowsError:
    print "Error"
