Search code examples
.netio

"All Users" Folder


Is there a .NET variable that returns the "All Users" directory?


Solution

  • You'll want to use the system.environment variables.
    Most of the predefined ones are shown here.

    For the "All Users" you would use:

    System.Environment.GetEnvironmentVariable("ALLUSERSPROFILE")
    

    I know I got a lot of upmods and a correct answer for my other stuff, but this actually works. where as the other environment variables I linked to previously don't seem to work with that function call.