write to file?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Espen

    write to file?

    I have this code..

    But I get this message: "The activeX-component can not established the
    object: scripting.files ystemobject?
    Do you know what is wrong?


    function writeToFile(){
    var TristateFalse = 0;
    var ForWriting = 2;
    var myActiveXObject = new ActiveXObject(" Scripting.FileS ystemObject");
    myActiveXObject .CreateTextFile ("c:\\test.txt" );
    var file = myActiveXObject .GetFile("c:\\t est.txt");
    var text = file.OpenAsText Stream(ForWriti ng, TristateFalse);
    text.Write("Hel lo World");
    text.Close();
    }


  • Laurent Bugnion, GalaSoft

    #2
    Re: write to file?

    Hi,

    Espen wrote:[color=blue]
    > I have this code..
    >
    > But I get this message: "The activeX-component can not established the
    > object: scripting.files ystemobject?
    > Do you know what is wrong?
    >
    >
    > function writeToFile(){
    > var TristateFalse = 0;
    > var ForWriting = 2;
    > var myActiveXObject = new ActiveXObject(" Scripting.FileS ystemObject");
    > myActiveXObject .CreateTextFile ("c:\\test.txt" );
    > var file = myActiveXObject .GetFile("c:\\t est.txt");
    > var text = file.OpenAsText Stream(ForWriti ng, TristateFalse);
    > text.Write("Hel lo World");
    > text.Close();
    > }[/color]

    Using ActiveX to write to files works only in IE, and only in a relaxed
    security environment. Typically, this won't work in the Internet
    security zone. This is probably your problem.

    Change your security settings and try again.

    Laurent
    --
    Laurent Bugnion, GalaSoft
    Webdesign, Java, JavaScript: http://www.galasoft-LB.ch
    Private/Malaysia: http://mypage.bluewin.ch/lbugnion
    Support children in Calcutta: http://www.calcutta-espoir.ch

    Comment

    Working...