Is it possible to preserve OS variables being used as command line arguments.
For example: Test.exe %Temp%
has the expanded temp variable, not the variable itself.
So:
Console.WriteLine("Args:\n");
foreach (string cl in args)
{
Console.WriteLine(cl);
}
Outputs something like:
Args:
C:\Temp
What I need is for the variable to remain unexpanded:
Args:
%Temp%
You need to escape the percentages like this:
Test.exe ^%Temp^%. With this you should get the desired output.