how to change the supportpath in c#

Hi,
I have a Script to save something to the supportpath by Start und a Script that delete something by supportpath but it isn't deleted.
I have found that a registeris: Computer\HKEY_CURRENT_USER\Software\Bricsys\BricsCAD\V23x64\de_DE\Profiles\Default\Config\SRCHPATH.

My Question is muss i change the registry path too or I make was bad ?

Thank for your response

var acadComApp = Application.AcadApplication as AcadApplication;
acadComApp.Preferences.Files.SupportPath = SupportPathUtils.RemoveInfrasignPaths(acadComApp.Preferences.Files.SupportPath);

internal static string RemoveInfrasignPaths(string cadSupportPaths)
{
if (string.IsNullOrEmpty(cadSupportPaths))
{
return string.Empty;
}

string[] cadSupportPathsArray = cadSupportPaths.Split(';');
IEnumerable akgPaths = GetRegisteredInfrasignPaths();
StringBuilder newCadSupportPath = new StringBuilder();

// Supportpfad des CAD Systems durchgehen und alle INFRASIGN Pfade herausfiltern
foreach (string supportPath in cadSupportPathsArray)
{
// Pfad entspricht dem INFRASIGN Suchstring.
// -> Nicht in die Rückgabe aufnehmen und überspringen.
//if (Regex.IsMatch(supportPath, VESTRA_PATH_REGEX))
if (!string.IsNullOrEmpty(supportPath)
&& akgPaths.FirstOrDefault(akgPath => !string.IsNullOrEmpty(akgPath)
&& string.Compare(System.IO.Path.GetFullPath(akgPath).TrimEnd('\\'),
System.IO.Path.GetFullPath(supportPath).TrimEnd('\\'),
StringComparison.InvariantCultureIgnoreCase) == 0) != null)
{
continue;
}

// INFRASIGN Suchstring nicht im Pfad enthalten.
// Sind bereits Pfade im Rückgabestring enthalten?
if (newCadSupportPath.Length != 0)
{
// Bereits bestehende Pfade mit Semikolon trennen.
newCadSupportPath.Append(";");
}

newCadSupportPath.Append(supportPath);
}

return newCadSupportPath.ToString();
}