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:
We have 1000s of tutorials on our website. Search Tutorials tutorials on our website.
Posted on: April 18, 2011 If you enjoyed this post then why not add us on Google+? Add us to your Circles