Reputation: 4708
I'm copying some files to a special folder when installing. The SpecialFolder path depends on for how the user choosed to install the app: 'Everyone' or 'Just me'.
From C# code I get the special folder path using Environment.GetFolderPath() method but this method always return the special path of the current user. If the user installed the app for everyone I need the path to the 'All Users' folder. How can I get from C# code the right SpecialFolder path?
Upvotes: 1
Views: 1479
Reputation: 2997
You could use:
Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)
http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx
Upvotes: 4
Reputation: 380
to get all users path use Environment.GetEnvironmentVariable("ALLUSERSPROFILE")
..than check that folder and user specified folder for your files
Upvotes: 0