Knowledge Base

PRB: FileSystemObject Object Causes Scripting Error

PSS ID Number: 190245

Article Last Modified on 12/1/2003


The information in this article applies to:


This article was previously published under Q190245

SYMPTOMS

When the FileSystemObject object is instantiated by Internet Explorer 3.x with Scripting 2.0, the error message "Object not safe for scripting" appears. This warning occurs regardless of the current security setting.

CAUSE

The FileSystemObject object is not considered safe for scripting because it allows access to the hard disk.

With objects not considered safe for scripting, a safety error can be suppressed by the user setting the appropriate Internet Explorer security setting. By modifying the settings in the Internet Options dialog box, the browser can be set to prompt the user or disregard the error.

For the FileSystemObject object, Internet Explorer 3.x does not respect this security setting and will always display the error message.

RESOLUTION

This problem has been fixed in Internet Explorer 4.0.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
This bug has been corrected in Internet Explorer 4.0.

MORE INFORMATION

Steps to Reproduce Behavior

Place the following script in the BODY tag of an HTML file and navigate to it using Internet Explorer 3.x with Scripting 2.0 installed.
<SCRIPT Language="VBScript">
<!--
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set a = fs.CreateTextFile("c:\testfile.txt", True)
    a.WriteLine("This is a test.")
    a.Close
-->
</SCRIPT>
				

REFERENCES

For more information about developing Web-based solutions for Microsoft Internet Explorer, visit the following Microsoft Web sites:

Keywords: kbFAQ kbprb KB190245
Technology: kbAudDeveloper kbIEsearch kbJScript200 kbJScriptSearch kbSDKIE300 kbSDKIE301 kbSDKIE302 kbSDKIESearch kbVBScript200 kbVBScriptSearch