Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are .NET User Settings stored IF User = SYSTEM?

I've been working with an updated to update one of my apps and using Properties.Settings.Default.Upgrade() and discovered that after my updater restarts my app, it is run under the SYSTEM user instead of the default/logged in user.

This got me wondering, where is the user.config for SYSTEM stored?
I know where the user.config is stored normally (C:\Documents and Settings\%USERPROFILE%\Local Settings\Application Data\etc...), but there isn't a folder in Documents and Settings for the SYSTEM user. Does anybody know where it is or/how .NET handles this?

like image 500
Marcus Avatar asked Jun 16 '11 21:06

Marcus


People also ask

Where are .NET user settings stored?

The values of any user-scoped settings that the user changes at runtime (for example, the position of a form) are stored in a user. config file. Notice that the default values are still saved in app. config.

Where are user settings saved C#?

User settings are saved in a file within a subfolder of the user's local hidden application data folder.

Where are Windows user settings stored?

If you store settings for all users, then they'll be in the corresponding folder under C:\users or C:\Documents and Settings for all user profiles (ex: C:\users\public\appdata\local ).

Where are C# properties stored?

It is a common requirement for many developers, and with C# it is really simple to do. The Microsoft.NET Framework 2.0 introduced a new item called the Settings File. This file is added to your project by default and can be found under the Properties folder within Visual Studio's Solution Explorer.


2 Answers

The Local Application Data folder for the SYSTEM account is usually located in

C:\Windows\system32\config\systemprofile\Local Settings\Application Data\

for Windows XP and

C:\Windows\system32\config\systemprofile\AppData\Local\

for later versions.

(I write usually, because

  • Windows does not need to be installed in C:\Windows, and

  • the folder names Local Settings and Application Data are localized in Windows XP, and

  • on 64-bit versions of Windows, the folder for 32-bit applications is located underneath C:\Windows\SysWOW64 instead of System32.)

like image 80
Heinzi Avatar answered Sep 26 '22 01:09

Heinzi


Since I don't know the answer, I would do the following to figure out:

  1. Install SysInternals Process Monitor (Direct download).
  2. Start Process Monitor, set the filter Path to your application's name.
  3. Start your application.
  4. Watch the locations inside Process Monitor.

This helped me often in the past, maybe it could be something for you, too?

like image 42
Uwe Keim Avatar answered Sep 27 '22 01:09

Uwe Keim