Registry Editing in scripts. - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4) +---- Forum: Scripting (/forumdisplay.php?fid=39) +----- Thread: Registry Editing in scripts. (/showthread.php?tid=61525) Registry Editing in scripts. by Terry_K on 06-26-2006 at 08:31 AM
Would anyone know how to edit the registry using a Messenger Plus! Live script? I can do it with Visual Basic .NET but it would help if someone told me how to write it in a script. RE: Registry Editing in scripts. by Ezra on 06-26-2006 at 08:34 AM
quote: I would read that Manual If I were you, lots of examples in it. RE: Registry Editing in scripts. by Terry_K on 06-26-2006 at 08:36 AM
Thank you. RE: RE: Registry Editing in scripts. by mathieumg on 06-26-2006 at 11:48 AM
quote: That's what he meant RE: Registry Editing in scripts. by The_Joker on 06-27-2006 at 01:00 PM
Tried to use this script but with a function to read & write. code: RE: Registry Editing in scripts. by CookieRevised on 06-27-2006 at 01:48 PM
quote: If you do that and you look up MsgPlus.ScriptRegPath in the scripting documentation (or you do simply a test with that object alone) you'll see that it returns a registry path. Now you append the variable "key" to it, in other words you append a string to a path without anything else.... thus there is something missing in between... Think of it as a file and directory: "C:\Program Files\MSN Messenger" would be the path and "msnmsgr.exe" the file, append the two and you'll get: "C:\Program Files\MSN Messengermsnmsgr.exe" which is obviously something not correct as there is a "\" missing... In other words: Shell.RegRead(MsgPlus.ScriptRegPath + "\\" + key); note that you need to put a double "\" as it is otherwise interpreted as a literal escape code So change that in your example and run it again.... The script will again not give the desired result. Why? Because you have other errors. The proper syntax for a "return" statement is: return <variable>; and "value = Shell.RegRead(MsgPlus.ScriptRegPath + key)" is not a value but a statement on its own. So either you do: var value = Shell.RegRead(MsgPlus.ScriptRegPath + key); return value; or simply: return Shell.RegRead(MsgPlus.ScriptRegPath + key); RE: Registry Editing in scripts. by The Brain on 06-27-2006 at 01:57 PM
quote: Sorry Cookie, but Plus gives you a Registry path ending with a backslash. If fixing the return statement doesn't fix it, I would imagine the error is because the variable key is not valid. Registry keys are case sensitive as awell, aren't they? Open regedit (via Start > Run) and check that the key you are looking for is actually there. The Scripts Registry path is: "HKEY_CURRENT_USER\Software\Patchou\Messenger Plus! Live\GlobalSettings\Scripts\" Followed by the name of the script. RE: Registry Editing in scripts. by CookieRevised on 06-27-2006 at 02:08 PM
quote:yeah, I noticed and was editing my post while you posted... Thanks for notifying though quote:Nope, they are case insensitive... PS: note that the ActiveX registry object methods are rather limited though... to do more registry manipulation (or even writing binary data etc) you need to use the Windows APIs. RE: Registry Editing in scripts. by The_Joker on 06-27-2006 at 02:32 PM
yeah, thought about the "return value = ..." thing... RE: Registry Editing in scripts. by matty on 06-27-2006 at 02:49 PM
This is what I use for Screenshot Sender 4. If you choose to keep the script you must keep the header regardless if you change the file or not. RE: Registry Editing in scripts. by The_Joker on 06-27-2006 at 03:19 PM
This script is completely different from the one mentioned here. RE: Registry Editing in scripts. by matty on 06-27-2006 at 03:25 PM
quote:How is my script different? You are trying to use an ActiveXObject to read the registry. I am using the Windows API to read the registry. I don't see how this is different at all in any way, aside from mione providing more control; longer code; and using more memory. code: Again I don't see how they differ at all. RE: RE: Registry Editing in scripts. by CookieRevised on 06-28-2006 at 01:15 AM
quote:already answered CookieRevised's reply to Registry Editing in scripts. quote: RE: RE: RE: Registry Editing in scripts. by The_Joker on 06-28-2006 at 10:20 AM
quote: As I said, it doesn't work either... The return thing gives an error not matter what I do. RE: Registry Editing in scripts. by Ezra on 06-28-2006 at 10:26 AM
What is the error code that you get? RE: RE: Registry Editing in scripts. by The_Joker on 06-28-2006 at 10:31 AM
quote:1. Back to good old 7.5, so I can't check the error number. 2. The code is/are: code: code:Both gives the same error if I remember correctly. RE: Registry Editing in scripts. by Ezra on 06-28-2006 at 10:38 AM Only thing I can think of is that the key doesn't excist... RE: RE: Registry Editing in scripts. by The_Joker on 06-28-2006 at 10:41 AM
quote: I checked it exists. It works okay with Debug.Trace but return doesn't. Also I checked with regedit, it's there. RE: Registry Editing in scripts. by matty on 06-28-2006 at 12:18 PM
Have you tried the script I posted? Just save it to a seperate JS file then call its function. RE: RE: RE: Registry Editing in scripts. by CookieRevised on 06-29-2006 at 06:12 PM
quote:There is nothing wrong in that latest code. The error is as Ezra suggested the key value you give to the function which doesn't exit or whatever. It works fine here. |