quote:
Originally posted by Suxsem
if I use Shell.RegDeleteTree function script return an error...
Because there is no such function or method.
The three existing function methods are:
WshShell.RegDelete
WshShell.RegWrite
WshShell.RegRead
quote:
Originally posted by Suxsem
if I use Shell.RegDelete function I can't delete e subkey of a key...
how can I do?
Yes you can. But that subkey must be empty; it can not contain other subkeys. You must remove the lowest subkey first and working your way up the tree, if you want to keep on using those build-in registry object functions.
Also, specify a key-name by ending the string with a final backslash and leave the final backslash off to specify a value-name.
eg:
this will remove the
value 'MindReader':
WshShell.RegDelete("HKCU\\Software\\ACME\\FortuneTeller\\MindReader");
this will remove the
key 'FortuneTeller':
WshShell.RegDelete("HKCU\\Software\\ACME\\FortuneTeller\\");
All this is also explained in the
Windows Scripting documentation which you can download from the
Official Script Database.
-------
Otherwise, use the Windows API directly like Matikke showed.