This sets up the SWR extension and associates it with notepad { regKey->RootKey = HKEY_CLASSES_ROOT; regKey->OpenKey("\\txtfile\\shell\\open\\command",true); TXTLocation = regKey->ReadString(""); regKey->OpenKey("\\.SWR",true); regKey->WriteString("","SWR_auto_file"); regKey->OpenKey("\\SWR_auto_file",true); regKey->WriteString("", "SWR ReportFile"); regKey->OpenKey("\\SWR_auto_file\\DefaultIcon",true); regKey->WriteString("",(ProgramPath + "ReportFile.ico,0")); regKey->OpenKey("\\SWR_auto_file\\shell\\open\\command",true); regKey->WriteString("", TXTLocation); } This sets up the RUS extension and associates it with the current program as well as ensuring the program auto-opens when the .RUS file is double-clicked. String ProgExe = ExtractFilePath(Application->ExeName); String ProgramPath = ProgExe; ProgExe = ProgExe + ExtractFileName(Application->ExeName) + " %1"; TRegistry* regKey = new TRegistry(); regKey->RootKey = HKEY_CLASSES_ROOT; // register icon if(!regKey->ReadString("\\RUS_auto_file\\shell\\open\\command").Pos('1')); { regKey->OpenKey("\\.RUS",true); regKey->WriteString("","RUS_auto_file"); regKey->OpenKey("\\RUS_auto_file",true); regKey->OpenKey("\\RUS_auto_file",true); regKey->WriteString("", "RUS Russian Text File"); regKey->OpenKey("\\RUS_auto_file\\DefaultIcon",true); regKey->WriteString("",(ProgramPath) + "RusIcon.ico,0"); regKey->OpenKey("\\RUS_auto_file\\shell\\open\\command",true); regKey->WriteString("", ProgExe); } delete regKey;