Python to Shell script? to Registry Change ... and beyond...?


jro11

Active member
Member
Local time
9:00 AM
Posts
466
OS
Win11 Home
When I posted “Using the Registry (aka R3g!xtRY)” I hoped I would learn how to make registry changes.

I got a sympathetic response, and I got to know users I remembered and respected. But it seems there was actually very little out there that might teach me how to make registry changes. I wasn’t quite successful in my attempts to change the registry (those changes I so carefully implemented didn't happen)—that convinced me I needed to learn to operate a Windows imaging program (MacriumR) so I would be able to make up for my mistakes by, every time I made a mistake, reinstalling everything on the disk.

Now that I’ve purchased MacriumR (but not yet been sent access to the program), and hoping to be able to use this same program to backup (Clone) AND Image the drive.

I’m wondering how far I’ll get… a) Ghot linked “Macrium Reflect and AOMEI Backupper--Guides”; b) Bree joined in with the ‘Bible’ “Windows Internals Book – Sysinternals” ; c) Ghot Windows XP Annoyances; d) all intelligently disintegrating into a discussion about Mark Russinovich…

What I’ve REALLY wanted to do because this would complement all the skill sets I would like to develop (though these days the whole subject of adopting a sensible attitude toward a Microsoft development seems hopeless) would be to be able to, in order of complexity:

USE PYTHON (since C++ days, another lifetime, I’ve been “”wed” to OOP) TO:
a) Reliably create and execute Shell Scripts, then
b) Reliably run (backup (cloning) and imaging) software
b) Reliably affect the Windows registry.

So that, in the future I can reliably use a single tool (Python) to schedule and execute, and re-execute if necessary, small scale tasks. And if need be, to expand to larger tasks, like the perfect filing system program (for the Mac) Infolog, that disappeared in the ether.

Is this a reasonable hope?
 

My Computers

System One System Two

  • OS
    Win11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Dell Inc. Inspiron 16 7610
    CPU
    Dell Inc. 0FHWFD A01
    Motherboard
    Dell Inc. 0FHWFD A01
    Memory
    16GB
    Graphics Card(s)
    2.30 gigahertz Intel 11th Gen Core i7-11800H
    Sound Card
    Intel® Smart Sound Technology for USB Audio
    Monitor(s) Displays
    laptop (small) and 1 or 2 external monitors
    Screen Resolution
    -
    Hard Drives
    PC711 NVMe SK hynix 1TB 1.02 TB NVMe ANB2N582412102F0G_0001
    PSU
    -
    Case
    Laptop
    Cooling
    fan
    Keyboard
    External!
    Mouse
    External
    Internet Speed
    -
    Browser
    Chrome (Chrome profiles), Firefox (Bookmark Search Plus2), Edge (History page), Opera (annoying)
    Antivirus
    WinDefender
    Other Info
    Win11 Home 23H2 22631.3447
  • Operating System
    Win10
    Computer type
    PC/Desktop
    Manufacturer/Model
    self
    Motherboard
    Gigabyte B75M-D3H
    Memory
    8068 MB Usable Installed Memory
    Graphics card(s)
    2.30 gigahertz Intel 11th Gen Core i7-11800H
    Sound Card
    Intel® Smart Sound Technology for USB Audio
    Monitor(s) Displays
    3 Displays
    Screen Resolution
    n/a
    Hard Drives
    SSD and others (internal and external)
    Case
    Desktop
    Cooling
    Fan
    Mouse
    External
    Keyboard
    External
    Browser
    Chrome, Firefox, Tor, Brave, Opera, etc.
    Antivirus
    Win Defender
    Other Info
    Win10 & unfortunately OneDrive: Can't completely rid myself of this!!
Why do you need to use Python or some other programming language to manipulate the registry? It doesn't make it any less or more "reliable" unless you wish to make sweeping changes to the registry which I would advise against.

I'm not sure why you would need to call a third-party backup from Python either? Just use the backup program itself to make scheduled backups or manually do itself yourself before making any changes, as programmatically doing so would only really work if Macrium has provided a set of APIs or command-line arguments in order to do so.

What are you exactly trying to achieve? Understand what all the keys and values in the registry are used for? You aren't going to find that information all in one place and most of it is undocumented. The Windows Internals book only really touches on how the registry is managed by the configuration manager - there is much better third-party research on this though - and doesn't actually mention what the keys are used for apart from a few system ones. Having said that, the Windows Internals book is quite lacking in many places, and only serves as a foundation rather than an be all and end all.
 

My Computer

System One

  • OS
    Windows 11, Windows 10, Linux Fedora Cinnamon
  • Like
Reactions: OAT
Why do you need to use Python or some other programming language to manipulate the registry? It doesn't make it any less or more "reliable" unless you wish to make sweeping changes to the registry which I would advise against.

I'm not sure why you would need to call a third-party backup from Python either? Just use the backup program itself to make scheduled backups or manually do itself yourself before making any changes, as programmatically doing so would only really work if Macrium has provided a set of APIs or command-line arguments in order to do so.

What are you exactly trying to achieve? Understand what all the keys and values in the registry are used for? You aren't going to find that information all in one place and most of it is undocumented. The Windows Internals book only really touches on how the registry is managed by the configuration manager - there is much better third-party research on this though - and doesn't actually mention what the keys are used for apart from a few system ones. Having said that, the Windows Internals book is quite lacking in many places, and only serves as a foundation rather than an be all and end all.
Very sound advice.
I wanted a give you a 'like' but it won't let me.
 

My Computers

System One System Two

  • OS
    Win11 All /Debian/Arch
    Computer type
    Laptop
    Manufacturer/Model
    ASUSTeK COMPUTER INC. TUF Gaming FX705GM
    CPU
    2.20 gigahertz Intel i7-8750H Hyper-threaded 12 cores
    Motherboard
    ASUSTeK COMPUTER INC. FX705GM 1.0
    Memory
    24428 Megabytes
    Graphics Card(s)
    Intel(R) UHD Graphics 630 / NVIDIA GeForce GTX 1060
    Sound Card
    Intel(R) Display Audio / Realtek(R) Audio
    Monitor(s) Displays
    Integrated Monitor (17.3"vis)
    Screen Resolution
    FHD 1920X1080 16:9
    Hard Drives
    2 SSD SATA/NVM Express 1.3
    WDS500G2B0A-00SM50 500.1 GB
    WDCSDAPNUW-1002 256 GB
    PSU
    19V DC 6.32 A 120 W
    Cooling
    Dual Fans
    Mouse
    MS Bluetooth
    Internet Speed
    Fiber 1GB Cox -us & ADSL Bouygues -fr
    Browser
    Edge Canary- Firefox Nightly
    Antivirus
    Windows Defender
    Other Info
    VMs of Windows 11 stable/Beta/Dev/Canary
    VM of XeroLinux- Arch based & Debian 12
  • Operating System
    Windows 11 Insider Canary
    Computer type
    Laptop
    Manufacturer/Model
    ASUS X751BP
    CPU
    AMD Dual Core A6-9220
    Motherboard
    ASUS
    Memory
    8 GB
    Graphics card(s)
    AMD Radeon R5 M420
    Sound Card
    Realtek
    Monitor(s) Displays
    17.3
    Screen Resolution
    1600X900 16:9
    Hard Drives
    1TB 5400RPM
But it is so intimidating; so sensitive; so critically able to mess up your computer (or so I've been told), that for me to even consider trying to modify Win11 so that it acts more like Win10, a version of Windows that apparently respects its user base more than its successor, seems insane.
I've already given it a try, and failed miserably.

This should be easy. I'm going to supply a step-by-step guide. If I can get the first suggested registry 'repair' to work, I think it should be smooth sailing from there. But I've been wrong before--and anyway, I failed my first attempt.
From your original thread, it seems that you want to edit some registry settings so it behaves like Windows 10? You'll be better off installing some third-party software which does this for you rather than attempting to edit some registry settings which may or may not do what you desire.

Very sound advice.
I wanted a give you a 'like' but it won't let me.
Thanks, and no worries, you've probably hit your reputation limit for the day, at least that's how the old forum software used to work.
 

My Computer

System One

  • OS
    Windows 11, Windows 10, Linux Fedora Cinnamon
you've probably hit your reputation limit for the day, at least that's how the old forum software used to work.
That's the thing, I haven't issued any today.
Maybe @Brink can help.
 

My Computers

System One System Two

  • OS
    Win11 All /Debian/Arch
    Computer type
    Laptop
    Manufacturer/Model
    ASUSTeK COMPUTER INC. TUF Gaming FX705GM
    CPU
    2.20 gigahertz Intel i7-8750H Hyper-threaded 12 cores
    Motherboard
    ASUSTeK COMPUTER INC. FX705GM 1.0
    Memory
    24428 Megabytes
    Graphics Card(s)
    Intel(R) UHD Graphics 630 / NVIDIA GeForce GTX 1060
    Sound Card
    Intel(R) Display Audio / Realtek(R) Audio
    Monitor(s) Displays
    Integrated Monitor (17.3"vis)
    Screen Resolution
    FHD 1920X1080 16:9
    Hard Drives
    2 SSD SATA/NVM Express 1.3
    WDS500G2B0A-00SM50 500.1 GB
    WDCSDAPNUW-1002 256 GB
    PSU
    19V DC 6.32 A 120 W
    Cooling
    Dual Fans
    Mouse
    MS Bluetooth
    Internet Speed
    Fiber 1GB Cox -us & ADSL Bouygues -fr
    Browser
    Edge Canary- Firefox Nightly
    Antivirus
    Windows Defender
    Other Info
    VMs of Windows 11 stable/Beta/Dev/Canary
    VM of XeroLinux- Arch based & Debian 12
  • Operating System
    Windows 11 Insider Canary
    Computer type
    Laptop
    Manufacturer/Model
    ASUS X751BP
    CPU
    AMD Dual Core A6-9220
    Motherboard
    ASUS
    Memory
    8 GB
    Graphics card(s)
    AMD Radeon R5 M420
    Sound Card
    Realtek
    Monitor(s) Displays
    17.3
    Screen Resolution
    1600X900 16:9
    Hard Drives
    1TB 5400RPM
Why do you need to use Python or some other programming language to manipulate the registry? It doesn't make it any less or more "reliable" unless you wish to make sweeping changes to the registry which I would advise against.
OF COURSE one doesn't need Python to make registry changes! (Do I get a like for this?😄)

but I want to learn Python and rather than going the Hello World route I thought it would be interesting and instructive to learn how to have it do some fairly simple direct things (change a registry item, execute a shell script, add/remove OneDrive ...eventually create InfoLog...)

Learning aside, it could come in handy as a way to reissue a registry change, or macro, or shell script, if some Windows update comes along that reduces everything back to the status quo... And starting out with simple tasks seems a solid way to progress..

One could even issue 'solutions' as named Python programs; slap the right API on some and allow the user to have a more general purpose registry changer that could address particular problems; etc, etc, etc. all in the service of learning Python and getting something useful done.

Of course it could probably be done with Java, Basic, or C++ if one wants to go overboard. But I want to learn Python.
 
Last edited:

My Computers

System One System Two

  • OS
    Win11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Dell Inc. Inspiron 16 7610
    CPU
    Dell Inc. 0FHWFD A01
    Motherboard
    Dell Inc. 0FHWFD A01
    Memory
    16GB
    Graphics Card(s)
    2.30 gigahertz Intel 11th Gen Core i7-11800H
    Sound Card
    Intel® Smart Sound Technology for USB Audio
    Monitor(s) Displays
    laptop (small) and 1 or 2 external monitors
    Screen Resolution
    -
    Hard Drives
    PC711 NVMe SK hynix 1TB 1.02 TB NVMe ANB2N582412102F0G_0001
    PSU
    -
    Case
    Laptop
    Cooling
    fan
    Keyboard
    External!
    Mouse
    External
    Internet Speed
    -
    Browser
    Chrome (Chrome profiles), Firefox (Bookmark Search Plus2), Edge (History page), Opera (annoying)
    Antivirus
    WinDefender
    Other Info
    Win11 Home 23H2 22631.3447
  • Operating System
    Win10
    Computer type
    PC/Desktop
    Manufacturer/Model
    self
    Motherboard
    Gigabyte B75M-D3H
    Memory
    8068 MB Usable Installed Memory
    Graphics card(s)
    2.30 gigahertz Intel 11th Gen Core i7-11800H
    Sound Card
    Intel® Smart Sound Technology for USB Audio
    Monitor(s) Displays
    3 Displays
    Screen Resolution
    n/a
    Hard Drives
    SSD and others (internal and external)
    Case
    Desktop
    Cooling
    Fan
    Mouse
    External
    Keyboard
    External
    Browser
    Chrome, Firefox, Tor, Brave, Opera, etc.
    Antivirus
    Win Defender
    Other Info
    Win10 & unfortunately OneDrive: Can't completely rid myself of this!!
If you want to use Python, then take a look at the WinReg module: winreg — Windows registry access

You will need to be running as an administrator to make changes to certain keys though.
 

My Computer

System One

  • OS
    Windows 11, Windows 10, Linux Fedora Cinnamon
I've issued you a Like to thank you for being so patient, yet willing to take my enquiry seriously.

Also I'm taking a serious step back...abandoning any registry change attempts and accepting Win11 for the awful experience it is.

that for me to even consider trying to modify Win11 so that it acts more like Win10, a version of Windows that apparently respects its user base more than its successor, seems insane.
I've already given it a try, and failed miserably.
I don't know who's quote this is, but if you guys manage to fail (miserably) I know it's someplace I don't even want to go.

I used to enjoy using my computer. What I did with it was often challenging, but I could count on the machine being reliable. Now I have to fight my computer constantly. I dread using it.

But thank you, (and the rest of this forum). Sometimes it gives me hope.
 
Last edited:

My Computers

System One System Two

  • OS
    Win11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Dell Inc. Inspiron 16 7610
    CPU
    Dell Inc. 0FHWFD A01
    Motherboard
    Dell Inc. 0FHWFD A01
    Memory
    16GB
    Graphics Card(s)
    2.30 gigahertz Intel 11th Gen Core i7-11800H
    Sound Card
    Intel® Smart Sound Technology for USB Audio
    Monitor(s) Displays
    laptop (small) and 1 or 2 external monitors
    Screen Resolution
    -
    Hard Drives
    PC711 NVMe SK hynix 1TB 1.02 TB NVMe ANB2N582412102F0G_0001
    PSU
    -
    Case
    Laptop
    Cooling
    fan
    Keyboard
    External!
    Mouse
    External
    Internet Speed
    -
    Browser
    Chrome (Chrome profiles), Firefox (Bookmark Search Plus2), Edge (History page), Opera (annoying)
    Antivirus
    WinDefender
    Other Info
    Win11 Home 23H2 22631.3447
  • Operating System
    Win10
    Computer type
    PC/Desktop
    Manufacturer/Model
    self
    Motherboard
    Gigabyte B75M-D3H
    Memory
    8068 MB Usable Installed Memory
    Graphics card(s)
    2.30 gigahertz Intel 11th Gen Core i7-11800H
    Sound Card
    Intel® Smart Sound Technology for USB Audio
    Monitor(s) Displays
    3 Displays
    Screen Resolution
    n/a
    Hard Drives
    SSD and others (internal and external)
    Case
    Desktop
    Cooling
    Fan
    Mouse
    External
    Keyboard
    External
    Browser
    Chrome, Firefox, Tor, Brave, Opera, etc.
    Antivirus
    Win Defender
    Other Info
    Win10 & unfortunately OneDrive: Can't completely rid myself of this!!

My Computer

System One

  • OS
    Windows 11, Windows 10, Linux Fedora Cinnamon
It's your own words from this thread: Using the Registry (aka R3g!xtRY)
certainly sounded like me...and kudos to you for looking at my previous comments

Though I've been (extensively) involved with the Mac, and peripherally with Linux, I'm committed to Windows. Since the last OS has been discontinued and won't be supported longer than another year, one's pretty much committed to W11... (esp. when, as I've read in this forum, W12 is expected sometime 2024). If one is committed to a particular platform, and wants to be reasonably conversant with that platform it kind of behooves one "stay current" doesn't it?
 

My Computers

System One System Two

  • OS
    Win11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Dell Inc. Inspiron 16 7610
    CPU
    Dell Inc. 0FHWFD A01
    Motherboard
    Dell Inc. 0FHWFD A01
    Memory
    16GB
    Graphics Card(s)
    2.30 gigahertz Intel 11th Gen Core i7-11800H
    Sound Card
    Intel® Smart Sound Technology for USB Audio
    Monitor(s) Displays
    laptop (small) and 1 or 2 external monitors
    Screen Resolution
    -
    Hard Drives
    PC711 NVMe SK hynix 1TB 1.02 TB NVMe ANB2N582412102F0G_0001
    PSU
    -
    Case
    Laptop
    Cooling
    fan
    Keyboard
    External!
    Mouse
    External
    Internet Speed
    -
    Browser
    Chrome (Chrome profiles), Firefox (Bookmark Search Plus2), Edge (History page), Opera (annoying)
    Antivirus
    WinDefender
    Other Info
    Win11 Home 23H2 22631.3447
  • Operating System
    Win10
    Computer type
    PC/Desktop
    Manufacturer/Model
    self
    Motherboard
    Gigabyte B75M-D3H
    Memory
    8068 MB Usable Installed Memory
    Graphics card(s)
    2.30 gigahertz Intel 11th Gen Core i7-11800H
    Sound Card
    Intel® Smart Sound Technology for USB Audio
    Monitor(s) Displays
    3 Displays
    Screen Resolution
    n/a
    Hard Drives
    SSD and others (internal and external)
    Case
    Desktop
    Cooling
    Fan
    Mouse
    External
    Keyboard
    External
    Browser
    Chrome, Firefox, Tor, Brave, Opera, etc.
    Antivirus
    Win Defender
    Other Info
    Win10 & unfortunately OneDrive: Can't completely rid myself of this!!

Latest Support Threads

Back
Top Bottom