We received a VS2010 C# project that calls the function Environment.ExpandEnvironmentVariables();
I understand how to use this with a string such as “%variable%\something.exe”, but the code we received uses this string – “%%variable%%\something.exe”
What is the purpose of having two percent signs surrounding the variable? is this a variable pointing to a variable? if so how can this work without calling ExpandEnvironmentVariables twice?
%%variable%%\something.exewill expand to%<value of variable>%\something.exe.You don’t necessarily need a second call to ExpandEnvironmentVariables: the resulting string might get passed to an API that expands environment variables or it might get written to the registry as a REG_EXPAND_SZ or whatever.