What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » RegDeleteTree

RegDeleteTree
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: RegDeleteTree
You can use SHDeleteKey from the shlwapi library:
code:
// Registry key locations
var HKEY_CLASSES_ROOT = 0x80000000;
var HKEY_CURRENT_USER = 0x80000001;
var HKCU = HKEY_CURRENT_USER;
var HKEY_LOCAL_MACHINE = 0x80000002;
var HKEY_USERS = 0x80000003;

/**
* Registry_DeleteTree
* lKeyLocation: One of the HKEY_* constants, such as HKEY_CURRENT_USER
* sKey: Path of the key to delete
*/
function Registry_DeleteTree(lKeyLocation, sKey){
   return Interop.Call('shlwapi.dll', 'SHDeleteKeyW', lKeyLocation, sKey) === 0;
}

//EXAMPLE
var RegistryPath = MsgPlus.ScriptRegPath.substr(5); //Remove "HKCU\" prefix
Registry_DeleteTree(HKEY_CURRENT_USER, RegistryPath + "\\KeyToDelete");
For more information about this function, go to the MSDN page of SHDeleteKey.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
06-21-2008 06:34 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
RegDeleteTree - by Suxsem on 06-21-2008 at 02:41 PM
RE: RegDeleteTree - by Matti on 06-21-2008 at 06:34 PM
RE: RegDeleteTree - by CookieRevised on 06-21-2008 at 06:46 PM
RE: RegDeleteTree - by Suxsem on 06-23-2008 at 11:15 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On