I want to add subkey in windows registry using python winreg. See the below picture for better understanding.
Now, I'm using this code.
import winreg as rg
regkey = rg.OpenKey(rg.HKEY_CLASSES_ROOT, "Directory\shell", 0,rg.KEY_WRITE)
rg.SetValueEx(regkey, "IFO/dr",0,rg.REG_SZ, r"F:\IFO\dist\rename_folder.exe")
I just want to create the subkey and than want to add value.

To create a new sub_key, you need to use
winreg.CreateKeyEx(key, sub_key, 0, access=KEY_CREATE_SUB_KEY), wherekeyis the root HKEY_ (E.g. HKEY_LOCAL_MACHINE), andsub_keyis the fullpath key you want to create.