Running a .reg file from PC does its job, but successfully running it from UR doesnt work
I have a .reg file on my PC that when added to the registry, works fine (changes an obscure setting in my Realtek configuration that turns off Loudness Equalization). When double clicked it comes up with the dialog asking if I want to change the registry, then dialog to confirm it worked, and the setting in Realtek has now been changed.
os.open("C:/Users/NATHAN/Documents/# FIXES/Batch Files/Realtek - Loudness Equalization/Loudness Equalization - Off.reg");
works exactly the same in that it gives me the registry-change confirmation dialogs. So I know the UR syntax is fine, its definitely running the file - but the Realtek setting has not been changed. I have tried this multiple times back and forth between the PC .reg file and the UR button that runs it, the UR version doesn't make the necessary change (even giving me the same "successfully added to registry" dialog box.
How can this be a problem only when its coming from UR?
Maybe if you search the registry you will find a copy of the key you edited in the wrong place (different user).
That would give a clue. Otherwise it is strange that it completes successfully without the desired effect.
Then you could try running regedit.exe /s "path to and reg file" from os.start?
os.execute('"C:/windows/regedit.exe" /s "C:/Users/NATHAN/Documents/# FIXES/Batch Files/Realtek - Loudness Equalization/Loudness Equalization - Off.reg"')
I assume that didn't work?
This might help......
So maybe add.......
rundll32.exe USER32.DLL,UpdatePerUserSystemParameters ,1 ,True
to your Off.reg script.
Cheers mate, I've done that.
Didn't fix though, it is officially weird.
So what I've done is open a batch file from the remote. The batch file then runs a .reg file that makes the change. Then it pauses.
The pause is there so I can see the batch file is running without any doubt.
If I double-click the batch file in my Windows Explorer folder, it executes and pauses with no errors, and the change is effective (the Realtek setting is On or Off).
If I tap the remote button that fires the same batch file, it executes and pauses with no errors, but the change is not effective.
Haha. I keep going back to UR code to start to change method of running batch file (os.open, os.execute, etc), but the fact is that should be irrelevant - the batch file is being ran, which means its out of UR's hands. Craziness.
I've given up. I've just realised that that the "successful" change (where the option gets visually toggled) doesn't actually change the sound output :| If I then physically toggle it with my mouse, it changes the sound. I've just tumbled down the rabbit hole of Process Monitor trying to catch the reg changes made while I toggle button, to no avail.
From the UR error perspective, I think I might still investigate with other, friendlier registry changes.
It could be one of those registry changes that only take effect after a re-boot? as the registry is only read at boot by most programs.......