- Registry
Interesting for: local preferences
Application: use the Windows Script Host Shell object.
js code:
var oWshShell = new ActiveXObject("WScript.Shell");
//Write to a key value
oWshShell.RegWrite(MsgPlus.ScriptRegPath + "myvar", 3, "REG_DWORD");
//Read a key value
var myvar = oWshShell.RegRead(MsgPlus.ScriptRegPath + "myvar");
Alternatively, you can use the original Win32 functions to do this, but this requires more advanced coding. You could also look at other scripts for registry functions, such as my own Countdown Live in "Registry.js".
- XML
Interesting for: portable preferences
Application: use the XMLDOM.
- Text file
Application: use the FileSystemObject or the Win32 ReadFile function.
- INI file
Interesting for: language files and preferences
Application: use the FileSystemObject to read the file and parse it afterwards, or use GetPrivateProfileString if you're not going to make many calls.
For more information about the usage, try to
search the forums! Many methods have already been covered here.