damirarh / damirscorner-utterances

utteranc.es comments for https://damirscorner.com
0 stars 0 forks source link

/blog/posts/20150117-ManipulatingSettingsDatFileWithSettingsFromWindowsStoreApps.html #13

Open damirarh opened 1 year ago

damirarh commented 1 year ago

Imported

URL: https://www.damirscorner.com/blog/posts/20150117-ManipulatingSettingsDatFileWithSettingsFromWindowsStoreApps.html

damirarh commented 1 year ago

Imported comment written by postedhere on 2016-05-16T04:02:08

Before I get knee-deep in this, can I ask if this still works in Windows 10 even now?

damirarh commented 1 year ago

Imported comment written by Damir Arh on 2016-05-17T22:35:36

The settings.dat seems to have the same data format in Windows 10 as it did in Windows 8.1. I didn't try the PowerShell script but it should probably
still work just as good as it did.

damirarh commented 1 year ago

Imported comment written by postedhere on 2017-04-23T15:41:42

Any ideas on how to edit or replace the settings.dat file in Microsoft.Windows.ShellExperienceHost_cw5n1h2txyewy?

What we are trying to do is hide the calendar agenda in the clock/date flyout by default. (The clock/date flyout appears when you click the date/time on the taskbar.) We want it where the calendar agenda does not appear by default at the bottom; the user can manually add it back if they want.

The setting for hiding or showing the calendar agenda is stored in Packages\Microsoft.Windows.ShellExperienceHost_cw5n1h2txyewy\Settings\settings.dat.

When I try to load this hive, I get the following error message in Registry Editor:

settings
This file is in use.
Enter a new name or close the file that’s open in another program.

I guess the error makes sense, but I'm not sure what I can do about it. It's a catch 22: the settings.dat file not exist until a user logs in the first time, but once the user logs in, I can't change the settings.dat file because it's in use.

Are there any workarounds that you're aware of?

damirarh commented 1 year ago

Imported comment written by Damir Arh on 2017-04-23T16:04:23

Well, to load the hive, you could copy the settings.dat file to another location before attempting to load it. Even copying doesn't seem to work when the user is logged in, but you could log in as another user with administrative privileges and copy the file from the original user when he isn't logged in.

You'll also need to replace this file with a modified one when it isn't in use, though. Maybe you can somehow make sure it's there before the user's first login?

damirarh commented 1 year ago

Imported comment written by postedhere on 2017-04-23T17:24:02

In the past, when I've tried to put anything in Local/Packages, it gets overwritten by the "first login" process.

I could potentially login as another user, but what we are really trying to do is automate this on about 8000 devices, so you can see where doing anything manually starts to get nasty.

damirarh commented 1 year ago

Imported comment written by Damir Arh on 2017-04-23T19:11:42

I'm not really sure, what's locking the file, as even Handle can't find any matching handles for the file. Neither does killing explorer.exe help in any way.

Sure, doing anything manually is completely unmanageable at that scale. However, I don't think there's a way to modify the file while the user is logged in. And I have no idea how to do it in an automated way when he isn't.