PRB: Cannot Access Remote Files with the FileSystemObject

ID: Q197964


The information in this article applies to:


SYMPTOMS

When accessing remote resources with the FileSystemObject through Active Server Pages (ASP), one of the following errors occurs:


RESOLUTION

Use the following steps to resolve this problem:

  1. Open the User Manager on the remote computer and create an account named IUSR_machinename (of the Web server) and give that account the same password that is used on the IUSR_machinename on the Web server.

    NOTE: If you don't know the password of the IUSR_machinename then you will need to assign this user a new password. You will then need to change the password for this same account on the Web Server as well.


  2. Create a share on the remote server named "files" and assign Read/Write permissions to that share for the user you just created.


  3. Use the Internet Service Manager of IIS 4.0 to change the authentication method to anonymous access and synchronize the password with the account you created in the previous step:



  4. Created an ASP page in the Web Project to write to a text file like the following:
    
       <%
       Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject")
       Set MyFile =
       ScriptObject.OpenTextFile("\\<machinename>\files\myfile.txt", 8,true)
    
       MyFile.WriteLine "*** Write file test ***"
       Myfile.writeline "     file was written to at: " & Now
       Myfile.writeline " "
       MyFile.Close
       %>
     


  5. Save the page and preview it in the browser.


  6. The ASP code successfully created a text file located here:
    
       \\<machinename>\files\myfile.txt.
     



STATUS

This behavior is by design.


REFERENCES

For more information, please see the following article in the Microsoft Knowledge Base:

Q184566 : HOWTO: Set Up Duplicate Anonymous Account on Separate Server

For further information, please see the following articles on the MSDN Online Web Workshop:
http://www.msdn.microsoft.com/workshop/essentials/webmen/webmen100598.asp#hot : Querying Remote Databases

Additional query words:


Keywords          : kbASP kbScript kbVisID600 kbGrpASP kbDSupport 
Version           : winnt:
Platform          : winnt 
Issue type        : kbprb 

Last Reviewed: July 29, 1999