In HTA, you can use whatever ActiveX you want. FileSystemObject is the best solution for simple operations with folders and files, although it can only read and write text files. With this ActiveX Control, you can also create and delete folders and files, extract their properties, etc.
FSO and HTAs still work in IE9. However, all development and support was completed in IE7, so all HTML and JavaScript features (and errors) are at that level. To use the features available for IE9, use <meta http-equiv="x-ua-compatible" content="ie=9"> in <head> . This only works with single pages and cannot be used in frameset countries.
FileSystemObject: http://msdn.microsoft.com/en-us/library/6kxy1a51%28v=vs.84%29.aspx HyperText-Applications: http://msdn.microsoft.com/en-us/library/ms536471 % 28v = vs. 85% 29.aspx
Key Features in FileSystemObject
Create ActiveX:
fso=new ActiveXObject('Scripting.FileSystemObject');
Write file:
var oStream=fso.OpenTextFile('SAVE_PATH',2,true); oStream.WriteLine('YOUR_DATA');
Open the file:
var iStream=fso.OpenTextFile('OPEN_PATH',1,false); data=iStream.ReadLine();
See also WScript.Shell : http://msdn.microsoft.com/en-us/library/98591fh7%28v=vs.84%29.aspx
Teemu source share