Article ID: 276011 - Last Review: April 22, 2003 - Revision: 1.1

PRB: Error 800a0035 When You Use the FileSystemObject Object

This article was previously published under Q276011
Expand all | Collapse all

SYMPTOMS

When you use the FileSystemObject object from an Active Server Pages (ASP) page, you may receive one of the following error messages:
Server object error 'ASP 0177 : 800a0035'
Server.CreateObject Failed
filename.asp, line xx
The operation completed successfully.
-or-
Microsoft VBScript runtime (0x800A0035)
File not found
filename.asp, line xx

CAUSE

This error occurs because FileSystemObject cannot find the file that is being accessed (through the OpenTextFile, DeleteFile, or CopyFile methods, for example). This typically occurs for two reasons:
  • The file does not exist.
  • FileSystemObject is not looking for the file in the folder that you had expected. By default, if you do not specify a path, FileSystemObject searches the WinNT\System32 folder.

RESOLUTION

You can work around this problem in a few different ways:
  • Verify that the file exists before you try to access it. For example:
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    If objFSO.FileExists(Server.MapPath("filename.txt")) Then
         'OK to access the file.
         Set objFile = objFSO.OpenTextFile(Server.MapPath("filename.txt"),1) 
    Else
         'File not found.
    End If
    					
  • Use a fully qualified path and file name. For example:
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.OpenTextFile("c:\inetpub\wwwroot\filename.txt",1)
    					
  • Use the Server.MapPath method to map the virtual or relative path of the file to the full physical path of the file. For example:
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.OpenTextFile(Server.MapPath("filename.txt"),1) 
    					

REFERENCES

For additional information on the FileSystemObject object, click the article number below to view the article in the Microsoft Knowledge Base:
197964  (http://support.microsoft.com/kb/197964/EN-US/ ) PRB: Cannot Access Remote Files with the FileSystemObject

APPLIES TO
  • Microsoft Active Server Pages 4.0
Keywords: 
kberrmsg kbfso kbprb KB276011
Retired KB ArticleRetired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
 

Article Translations