Is it safe to programmatically reference the public folder through:
Directory = System.Environment.GetEnvironmentVariable(\"public\")+\"MyCompanyName\" // et
It depends on what you want to achieve. There is a enum called SpecialFolder. You can use it to get the Path to some Directories. For Example:
System.Environment.GetFolderPath(Environment.SpecialFolder.CommonDesktopDirectory)
points to "C:\Users\Public\Desktop".
IMHO, your way isn't wrong, though i would do some Exception Handling in case the EnvVar is really missing. Also you could use the ENUM with "CommonDesktopDirectory" and get rid of the "\Desktop" part.