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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top