Hello, I am trying to delete some registry keys and I am recieving errors. I have used this method before, but with only one or two at a time. This is the second time I have had this problem. The error said it was unable to delete keys. Is there a better way to delete reg keys. I have verified the path is correct.
Set oShell = WScript.CreateObject("WScript.Shell")
oShell.RegDelete "HKEY_USERS\S-1-5-18\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\0\1004"
'oShell.RegDelete "HKEY_USERS\S-1-5-21-1993962763-1637723038-725345543-1003\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\0\1004"
oShell.RegDelete "HKEY_USERS\S-1-5-20\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\0\1004"
oShell.RegDelete "HKEY_USERS\S-1-5-19\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\0\1004"
oShell.RegDelete "HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\0\1004"
Set oShell = WScript.CreateObject("WScript.Shell")
oShell.RegDelete "HKEY_USERS\S-1-5-18\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\0\1004"
'oShell.RegDelete "HKEY_USERS\S-1-5-21-1993962763-1637723038-725345543-1003\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\0\1004"
oShell.RegDelete "HKEY_USERS\S-1-5-20\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\0\1004"
oShell.RegDelete "HKEY_USERS\S-1-5-19\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\0\1004"
oShell.RegDelete "HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\0\1004"