tags:

views:

81

answers:

2

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?

A: 

to get all users path use Environment.GetEnvironmentVariable("ALLUSERSPROFILE")..than check that folder and user specified folder for your files

necrostaz
A: 

You could use:

Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)

http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx

martin