Shoutbox

Checking for stored settings - 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: Checking for stored settings (/showthread.php?tid=64507)

Checking for stored settings by Spunky on 08-05-2006 at 06:21 PM

Is there a way to check if settings are already stored in a file or the registry without causing an error? I tried to read a registry entry and check if the result was undefined, but it didn't work :P


RE: Checking for stored settings by Felu on 08-05-2006 at 06:27 PM

What exactally do u wanna check in the registries.

Get Registry key names from Start > Run > Regedit

Eg. to find chatlogs path in Backup Extreme! i use

code:
var Shell = new ActiveXObject('WScript.Shell');

Debug.Trace(Shell.RegRead('HKEY_CURRENT_USER\\Software\\Patchou\\Messenger Plus! Live\\' + Messenger.MyEmail + '\\Preferences\\LogsDirectory'))

RE: Checking for stored settings by Spunky on 08-05-2006 at 06:29 PM

Right, I've got the code to Read, Write and Remove registry keys, but what I want to do is check if the settings have been saved before...

I want to be able to load a users settings on startup, but if it's the first time the script has been run, it'll cause an error. So I just want to check if it infact exists first. I think for files theres something like IfFileExists...


RE: Checking for stored settings by Felu on 08-05-2006 at 06:34 PM

code:
var Shell = new ActiveXObject('WScript.Shell');

if (something ==
Shell.RegRead('key name')
{
dothis
}

is that what you want?


If it exist or not *-)
value = null or unidentified. Maybe
RE: Checking for stored settings by Spunky on 08-05-2006 at 06:35 PM

I'll just go and check it to see if it is :D thanks for quick replies

EDIT: Sorry, that returns the value of the key, I need to first check if the key exists


RE: Checking for stored settings by pollolibredegrasa on 08-05-2006 at 07:26 PM

Look at the example on the Scripting Wiki, I think this is what you want :)


RE: Checking for stored settings by Spunky on 08-05-2006 at 07:30 PM

Thankyou SO much! This worked a treat... I was getting onto the right lines at least :D