Programatic way to save\restore settings in Settings app

Page 1 of 2 12 LastLast

  1. Posts : 1,746
    Windows 10 Pro x64 22H2
       #1

    Programatic way to save\restore settings in Settings app


    Hello guys, I often times need to configure VM from scratch to have a clean testing environment, this means I also need to customize settings found in settings app for each user account.

    This process is very tedious so I was thinking if it's possible for me to write a PS script which will harvest status of all settings into a file, so that next time on fresh system I simply run the script and configure settings how I like.

    Do you think that's possible and if not maybe there is some program which will do this job however I prefer such program to be trusted of preferably opensource.

    Settings sync unfortunately doesn't sync everything and is not useful.
      My Computer


  2. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #2

    Hello @zebal,

    zebal said:
    Hello guys, I often times need to configure VM from scratch to have a clean testing environment, this means I also need to customize settings found in settings app for each user account.
    Is it one App or more than one App you are talking about ?

    I always customise my OS and most of it is done through .bat, .reg, and .ps1 files in a folder fit for purpose, and the rest is performed done manually.

    I did a bit of investigating for you and found this > PowerShell Module: Export your Computer Configuration

    I hope it helps.
      My Computer


  3. Posts : 776
    Windows 7
       #3

    Simple answer is create a snapshot of your VM session after post-setup. You roll back to the saved snapshot, every time you want to start testing. This guarantees absolute consistency.

    Settings app is an UI front-end to change many registry settings, which are scattered in different subkeys. Some per-user settings are hidden inside the users' CloudStore or AppData folders, and particularly hard to extract.

    While you can use a registry snapshot tool to capture changes, most will grab a ton of background changes related to normal system operation. Those are messy to filter out, if you don't know which ones.

    VM snapshots neatly solve your problem.
      My Computer


  4. Posts : 1,746
    Windows 10 Pro x64 22H2
    Thread Starter
       #4

    Paul Black said:
    Is it one App or more than one App you are talking about ?
    Only OS settings in "Settings" app (Start -> Settings)

    I'm not interested in settings of other apps or programs, just the user settings in the "Settings app"

    Paul Black said:
    I did a bit of investigating for you and found this > PowerShell Module: Export your Computer Configuration
    This is an interesting module indeed! I took a look at code on GitHub but it doesn't seem to export settings from settings app, it exports services, software list etc. but not OS settings.

    But it might prove useful if snapshots don't solve all the problems I expect.

    garlin said:
    Simple answer is create a snapshot of your VM session after post-setup. You roll back to the saved snapshot, every time you want to start testing. This guarantees absolute consistency.
    OK, I must admit how silly I am because I always disable snapshots because I never really understood them, but this sounds like a genuine solution!
    I will test how this works ASAP, if snapshots are able to preserve every system setting to the detail then that's great!

    ---

    Thank you guys for your replies.
      My Computer


  5. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #5

    Hello @zebal,

    Thanks for the reply and update.

    zebal said:
    OK, I must admit how silly I am because I always disable snapshots because I never really understood them, but this sounds like a genuine solution!

    I will test how this works ASAP, if snapshots are able to preserve every system setting to the detail then that's great!
    @garlin has provided an excellent suggestion that should hopefully resolve your issue.
      My Computer


  6. Posts : 1,203
    11 Home
       #6

    Yes, there is.. it's called M$ Power Automate.
      My Computers


  7. Posts : 1,767
    Windows 10 Pro (+ Windows 10 Home VMs for testing)
       #7

    hdmi said:
    Yes, there is.. it's called M$ Power Automate.
    Care to elaborate? Correct me if I'm wrong but I could find absolutely no mention of this capability on the Power Automate portal.
      My Computer


  8. Posts : 1,203
    11 Home
       #8

    RickC said:
    Care to elaborate? Correct me if I'm wrong but I could find absolutely no mention of this capability on the Power Automate portal.
    After you create a new desktop flow in Power Automate for desktop, you will see an Actions pane on the left. You will find a lot of the actions you need under the UI automation category and its subcategories. Here is a handy cheatsheet: Power Automate Desktop Actions Cheat Sheet by VJR - Download free from Cheatography - Cheatography.com: Cheat Sheets For Every Occasion
    The official Power Automate Desktop forum is here: https://powerusers.microsoft.com/t5/...d-p/MPADesktop

    EDIT: The problem with Windows Settings is that not all of the settings that can be accessed through it can also be accessed programatically, at least not in any way that would let you avoid using your voodoo skills. Typing in mojo in the search bar of the Microsoft Store does not seem to help much either. lol
      My Computers


  9. Posts : 1,767
    Windows 10 Pro (+ Windows 10 Home VMs for testing)
       #9

    hdmi said:
    After you create a new desktop flow in Power Automate for desktop, you will see an Actions pane on the left. You will find a lot of the actions you need under the UI automation category and its subcategories. Here is a handy cheatsheet: Power Automate Desktop Actions Cheat Sheet by VJR - Download free from Cheatography - Cheatography.com: Cheat Sheets For Every Occasion
    The official Power Automate Desktop forum is here: https://powerusers.microsoft.com/t5/...d-p/MPADesktop

    EDIT: The problem with Windows Settings is that not all of the settings that can be accessed through it can also be accessed programatically, at least not in any way that would let you avoid using your voodoo skills. Typing in mojo in the search bar of the Microsoft Store does not seem to help much either. lol
    I went through the cheat sheet and searched the 'Power Automate Desktop' forum and still couldn't find any way to, for example, retrieve a registry value without using PowerShell, VBScript, etc. so I'm not convinced Power Automate can be used as the OP wishes to retrieve/save/store settings.
      My Computer


  10. Posts : 1,203
    11 Home
       #10

    RickC said:
    I went through the cheat sheet and searched the 'Power Automate Desktop' forum and still couldn't find any way to, for example, retrieve a registry value without using PowerShell, VBScript, etc. so I'm not convinced Power Automate can be used as the OP wishes to retrieve/save/store settings.
    That's the whole problem... you can't simply extract all the settings related data you need from the Windows registry. In some cases where there does exist a matching setting in Windows registry, modifying the registry has no immediate effect until the next logon/logoff (or reboot) occurs so, for those specific settings, AFAIK the most practical way to accomplish the goal described by the OP is to interect with the UI elements of the Windows Settings window by using UI automation like I said, and, if you're not convinced, then unless you got some better idea, blame M$ for their blatant negligence, in this regard and in that of so many other areas that also are inherent of the OS.
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 08:00.
Find Us




Windows 10 Forums