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:
Microsoft VBScript runtime error '800a004c' Path not found
Microsoft VBScript runtime error '800a0046' Permission denied
Server object error 'ASP 0177 : 800a0046' Server.CreateObject Failed
RESOLUTION
Use the following steps to resolve this problem:
- 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.
- Create a share on the remote server named "files" and assign Read/Write permissions to that share for the user you just created.
- 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:
- Open the Internet Service Manager.
- Right-click the Web Application and select Properties.
- Select the Directory Security tab.
- Select Edit from the "Enable Anonymous Access and Authentication Control" section.
- From the dialog box that appears select make sure that "Allow
Anonymous Access" is selected and then click Edit.
- De-select the "Enable Automatic Password Synchronization" option and
type in the username(IUSR_machinename) and the password.
- 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
%>
- Save the page and preview it in the browser.
- 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