Syntax of ActiveXObject object:
|var newObject = new ActiveXObject(servername.typename[, location])|
The Active object takes three parts:
servername - the name of the application providing the object. It is required.
typename - the type or class of the object to create.
location - the name of the network server where the object is to be created.
Here, we have taken servername as 'Scripting' and typename as 'FileSystemObject':
Here is the code:
var object = new ActiveXObject("Scripting.FileSystemObject");
var file = object.CreateTextFile("C:\\Hello.txt", false);
file.WriteLine('Hope is a thing with feathers, that perches on the soul.');
<input type="Button" value="Create File" onClick='createFile()'>
Output will be displayed as:
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: April 18, 2011 If you enjoyed this post then why not add us on Google+? Add us to your Circles