Well as usual it wasn't quite that easy!!!
I tried several ways to load that folder, but it seems .NET applications do not like trying to load it directly. (When I tried to create a folder in the docs it said that folder already exists, which it didn't)
I ended up doing a bit of googling/prowling through stack overflow and found this neat little API that helps with libraries and such:
WindowsAPICodePack
So long story short Environment.SpecialFolder.Personal gets the
common documents repository for the current user.
I had to use the ShellLibrary component of the above API, use it to find the documents library as follows:
Code:
ShellLibrary Documents = ShellLibrary.Load("Documents", Path.Combine(Environment.GetEnvironmentVariable("appdata"), @"Microsoft\Windows\Libraries\"), false); Then get the full path of the library's
default save folder and then simply continue as per normal from there...
Code:
string ProgramDir = Path.Combine(Documents.DefaultSaveFolder, "NZB Watcher");
string OptionsFileName = Path.Combine(ProgramDir, "options.xml");
And Huzzah!!! It's now working perfectly! Thanks for your help mate