Registry key deletion
Published: October 25, 2018 - 7:57 PM
Good morning,
I am trying to delete a registry key in my Eraser installation package.
I first tried using WAPT's native method:
The installation was successful, but the removal failed.
I then tried with
But it makes me angry:
What is my problem?
THANKS!
I am trying to delete a registry key in my Eraser installation package.
I first tried using WAPT's native method:
Code: Select all
registry_deletekey(root=HKEY_LOCAL_MACHINE, path=r'SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers', keyname=r'c:\Program Files\Eraser\Eraser.exe')I then tried with
Code: Select all
run(r'reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "c:\Program Files\Eraser\Eraser.exe" /f')However, if I replace "run" with "print" and copy/paste the string into a command prompt as administrator, the deletion works correctly.CalledProcessErrorOutput: Command 'reg delete "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\Layers" /v "c:\\Program Files\\Eraser\\Eraser.exe" /f' returned non-zero exit status 1.
Output:u"Error: The system could not find the specified registry key or value.\r\n"
What is my problem?
THANKS!