Trouble deleting HKEY_LOCAL_MACHINE\SYSTEM\ ControlSet001\Enum\Root key

(imported topic written by DotA)

I believe it is a permissions issue but I am unable to delete a key under HKEY_LOCAL_MACHINE\SYSTEM\ ControlSet001\Enum\Root. Tried the following:

delete __appendfile

delete del.reg

appendfile REGEDIT5

appendfile [-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\KEY]

appendfile move __appendfile del.reg

wait regedit /s del.reg

Also tried:

If {exists key “HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\KEY” of registry}

Regdelete “HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\KEY” of registry

Endif

Manually tried deleting and getting “Cannot delete KEY: Error while deleting key.”

Anybody have a way to reset the permissions on the key to allow deletion?

(imported comment written by SergioBenavides)

Ran into the same issue a while ago, try this ( you’ll need to deploy psxec.exe into the target machine first)

if {exists key “HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\LEGACY_DXGKRNL” of registry}

waithidden “C:\Pstools\psexec.exe” -i -d -s reg delete “HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\LEGACY_DXGKRNL” /f

endif

(imported comment written by jgstew)

I thought you could do this without PSExec?