WinReg Not Creating A Dword

24 views Asked by At

I'm creating a text based python simulation that runs in the terminal; however, Since windows 10 by default does not show ANSI color escape sequences. I needed to create a Dword in the Console registry, which I can do manually, but I need this program in an exe and to run on others CPs. It does not seem to be working even though the program prints (DWORD value created successfully.). The Dword does not exist in the registry when I checked .

# THE COLOR REGISTRY
try:
    # Open the HKEY_CURRENT_USER key and the specified subkey
    with w.OpenKey(w.HKEY_CURRENT_USER, r"Console", 0, w.KEY_SET_VALUE) as key:
        # Set the value using SetValueEx
        w.SetValueEx(key, 'VirtualTerminalLevel', 0, w.REG_DWORD, 0x00000001)
        print("DWORD value created successfully.")
except Exception as e:
    print("An error occurred:", e)

I tried Running the program with privileges and in PowerShell.

0

There are 0 answers