expanding environment strings

  • Thread starter Thread starter codymanix
  • Start date Start date
C

codymanix

Hi!
I have a path in the following form:

"%USERPROFILE%\\test.txt"

and want to expand it to the original full path. I tried:

Path.GetFullPath("%USERPROFILE%\\test.txt")

but it didn't work either.
 
OK, I got it:

this.dstPath = Environment.ExpandEnvironmentVariables(dstPath);

did the job.
 
Back
Top