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?
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.
User settings are saved in a file within a subfolder of the user's local hidden application data folder.
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 ).
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.
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
.)
Since I don't know the answer, I would do the following to figure out:
Path
to your application's name.This helped me often in the past, maybe it could be something for you, too?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With