Thursday, June 24, 2010

Creating Folder and writtings file in JavaScript on the Client Via Active X

This function will create a folder and and Create a file inside that folder and writes the data into the file using the activex object .Inorder to do this we should enable the option on the browser -Enable active x object that marked as unsafe form the option menu of the IE

       function Callme() {
           var Tristate = 0;
           var Writing = 2;
           var myActiveXObject = new ActiveXObject("Scripting.FileSystemObject");
           file = myActiveXObject.CreateTextFile("c:\\Myfolder\\erroLog.xml");
           var stringText = "";
           stringText = "";
           stringText += "\nTove";
           stringText += "\nJani";
           stringText += "\nReminder";
           stringText += "\nDon't forget me this weekend!";
           stringText += "\n";
           file = myActiveXObject.CreateTextFile("c:\\Myfolder\\erroLog.txt");
           stringText = "This is a test";
           return false;


Post a Comment