Personaly, I work most with the registry, when you use a per user setting, your script directory will become quite full
This works better, imo
When you call ReadRegistry and the key does not exist, it will write the initvalue to the registry
That way you can give start string when your script runs for the first time
code:
function WriteRegistry (key, value) {
var Shell = new ActiveXObject("WScript.Shell");
return Shell.RegWrite(MsgPlus.ScriptRegPath + Messenger.MyUserId + "\\" + key, value, "REG_SZ");
}
function ReadRegistry (key) {
var Shell = new ActiveXObject("WScript.Shell");
try {
return Shell.RegRead(MsgPlus.ScriptRegPath + Messenger.MyUserId + "\\" + key);
} catch (e) {
WriteRegistry(key, initvalue);
return initvalue;
}
}
function RemoveRegistry (key) {
var Shell = new ActiveXObject("Wscript.Shell");
return Shell.RegDelete(MsgPlus.ScriptRegPath + Messenger.MyUserId + "\\" + key);
}