WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@Tatsh
Copy link
Contributor

@Tatsh Tatsh commented Sep 11, 2025

winprefs is my utility to mass dump the registry to various formats usable in other code. Effectively it is a code snippet generator.

Interface:

Usage: winprefs.exe [OPTION...] [REG_PATH]

If a path to a value name is specified, the output directory argument is ignored and the line is printed to standard output.

Options:
  -F, --format=FORMAT Format to output. Options: c, cs, c#, ps, ps1, powershell, reg. Default: reg.
  -K, --deploy-key    Deploy key for committing.
  -c, --commit        Commit changes.
  -d, --debug         Enable debug logging.
  -f, --output-file   Output filename.
  -m, --max-depth=INT Set maximum depth.
  -o, --output-dir    Output directory.
  -h, --help          Display this help and exit.

Because this is a native app it is extremely fast. It does have a PowerShell module but this only includes the native component.

winprefs.exe is the normal CLI version. winprefsw.exe accepts the same arguments but does not print to standard output, useful for automated tasks.

It can use Git to save changes, and even push when given a key.

Example output:

Default output to standard output with maximum depth 3:

$ winprefs -f - -m3
reg add "HKCU\AppEvents\Schemes" /ve /t REG_SZ /d ".Default" /f
reg add "HKCU\AppEvents\Schemes" /v "packagebase" /t REG_SZ /d "C:\WINDOWS\media" /f
reg add "HKCU\Console\%%%%Startup" /v "DelegationConsole" /t REG_SZ /d "{2EACA947-7F5F-4CFA-BA87-8F7FBEEFBE69}" /f
reg add "HKCU\Console\%%%%Startup" /v "DelegationTerminal" /t REG_SZ /d "{E12CFF52-A866-4C77-9A90-F570A7AA2C6B}" /f
...

C# output, custom path (even binary values are printed properly):

$ winprefs -f - -F cs -m3 'HKCU\System\GameConfigStore'
Registry.SetValue("HKEY_CURRENT_USER\\System\\GameConfigStore\\Children\\069e9773-6b7f-4613-b22a-447602fe702c", "Type", 1, RegistryValueKind.DWord);
Registry.SetValue("HKEY_CURRENT_USER\\System\\GameConfigStore\\Children\\069e9773-6b7f-4613-b22a-447602fe702c", "Revision", 2513, RegistryValueKind.DWord);
Registry.SetValue("HKEY_CURRENT_USER\\System\\GameConfigStore\\Children\\069e9773-6b7f-4613-b22a-447602fe702c", "Flags", 51, RegistryValueKind.DWord);
Registry.SetValue("HKEY_CURRENT_USER\\System\\GameConfigStore\\Children\\069e9773-6b7f-4613-b22a-447602fe702c", "Parent", { 0x01, 0x00, 0x00, 0x00, 0xd0, 0x8c, 0x9d, 0xdf, 0x01, 0x15, 0xd1, 0x11, 0x8c, 0x7a, 0x00, 0xc0, 0x4f, 0xc2, 0x97, 0xeb, 0x01, 0x00, 0x00, 0x00, 0xd6, 0x5c, 0xb9, 0x8a, 0x93, 0x3c, 0xb1, 0x44, 0x95, 0xea, 0x9c, 0x2d, 0xe8, 0xd8, 0x20, 0x9a, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x66, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0xae, 0xd4, 0xe3, 0xe7, 0x1a, 0x4d, 0xd5, 0xbc, 0x95, 0xe8, 0xe2, 0xff, 0xa2, 0xf9, 0x03, 0x01, 0x4a, 0xf4, 0x67, 0xdf, 0x34, 0xfb, 0x83, 0x2c, 0x86, 0xc8, 0x65, 0x7a, 0xac, 0x1e, 0x9a, 0xbe, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x80, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x36, 0x47, 0xca, 0x5d, 0xeb, 0x14, 0x8b, 0x05, 0xec, 0x8d, 0x10, 0xc6, 0x27, 0xcd, 0xe4, 0x49, 0x0c, 0xb7, 0xbf, 0x44, 0x7a, 0x97, 0x08, 0xa9, 0xff, 0x24, 0x77, 0x62, 0x4e, 0xfa, 0x61, 0xfe, 0x20, 0x00, 0x00, 0x00, 0x03, 0xb0, 0xef, 0x6e, 0x6b, 0xfa, 0x2e, 0x9f, 0xb8, 0x89, 0x71, 0xe9, 0x22, 0x5e, 0x47, 0x6a, 0x35, 0x12, 0x9e, 0xd8, 0x86, 0x2d, 0xde, 0x59, 0x86, 0x71, 0xbe, 0x40, 0xfe, 0x7b, 0x4b, 0xeb, 0x40, 0x00, 0x00, 0x00, 0x2e, 0xa5, 0x4e, 0x9c, 0x67, 0x18, 0x00, 0x9e, 0x5b, 0xd4, 0x49, 0xbd, 0xe6, 0x97, 0x9b, 0x4a, 0xa5, 0x98, 0x6a, 0x4a, 0xf7, 0x99, 0x63, 0xe3, 0x95, 0x56, 0x29, 0xc7, 0xa1, 0xd9, 0xd4, 0xac, 0x30, 0x52, 0x32, 0xff, 0xdb, 0x5b, 0xee, 0x12, 0xd2, 0x98, 0xe9, 0xb7, 0xa6, 0xb7, 0x83, 0xaa, 0xb7, 0x3f, 0xa9, 0xc1, 0x55, 0x0d, 0x08, 0x53, 0xe2, 0x56, 0x13, 0x08, 0x4f, 0x41, 0xd2, 0x33 }, RegistryValueKind.Binary);
...

PowerShell output:

$ winprefs -f - -F powershell
if (!(Test-Path 'HKCU:\AppEvents\Schemes')) { New-Item -Path 'HKCU:\AppEvents\Schemes' -Force | Out-Null } New-ItemProperty -LiteralPath 'HKCU:\AppEvents\Schemes' -Name '(Default)' -PropertyType String -Force -Value '.Default'
if (!(Test-Path 'HKCU:\AppEvents\Schemes')) { New-Item -Path 'HKCU:\AppEvents\Schemes' -Force | Out-Null } New-ItemProperty -LiteralPath 'HKCU:\AppEvents\Schemes' -Name 'packagebase' -PropertyType String -Force -Value 'C:\WINDOWS\media'
...

@Tatsh Tatsh force-pushed the winprefs branch 3 times, most recently from 83cec5b to 85e0291 Compare September 11, 2025 13:06
@lazka lazka added the new-package Pull request which adds new package(s) label Sep 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-package Pull request which adds new package(s)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants