By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,379 Members | 1,748 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,379 IT Pros & Developers. It's quick & easy.

write to file?

P: n/a
I have this code..

But I get this message: "The activeX-component can not established the
object: scripting.filesystemobject?
Do you know what is wrong?
function writeToFile(){
var TristateFalse = 0;
var ForWriting = 2;
var myActiveXObject = new ActiveXObject("Scripting.FileSystemObject");
myActiveXObject.CreateTextFile("c:\\test.txt");
var file = myActiveXObject.GetFile("c:\\test.txt");
var text = file.OpenAsTextStream(ForWriting, TristateFalse);
text.Write("Hello World");
text.Close();
}
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

Espen wrote:
I have this code..

But I get this message: "The activeX-component can not established the
object: scripting.filesystemobject?
Do you know what is wrong?
function writeToFile(){
var TristateFalse = 0;
var ForWriting = 2;
var myActiveXObject = new ActiveXObject("Scripting.FileSystemObject");
myActiveXObject.CreateTextFile("c:\\test.txt");
var file = myActiveXObject.GetFile("c:\\test.txt");
var text = file.OpenAsTextStream(ForWriting, TristateFalse);
text.Write("Hello World");
text.Close();
}


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

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.