If I type %APPDATA%\Skype
into Windows Explorer then Windows Explorer shows me the content of C:\Users\Stevew\AppData\Roaming\Skype
.
But if I do this in C#
Directory.GetFiles(@"%APPDATA%\Skype");
then I get an exception saying Could not find a part of the path 'C:\\Users\\Stevew\\Documents\\Visual Studio 2010\\Projects\\TestSkype\\TestResults\\Stevew_PC 2014-05-29 15_45_30\\Out\\%APPDATA%\\Skype'
.
I suppose the %APPDATA%
-part was not parsed. How can read the content of C:\Users\Stevew\AppData\Roaming\Skype
using this syntax?
I know about Environment.SpecialFolder.ApplicationData
, but I want to use the %SOMETHING%
-syntax in this case, I want to be able to use any of the environment variables. I've tried to search, but I don't really know what to search for.